using System;
using Cpp2IlInjected;
using UnityEngine;

// Token: 0x0200001C RID: 28
[Token(Token = "0x200001C")]
public class SceneBGMController : MonoBehaviour
{
	// Token: 0x060000B5 RID: 181 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60000B5")]
	[Address(RVA = "0x432590", Offset = "0x431390", VA = "0x180432590")]
	public void Init()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060000B6 RID: 182 RVA: 0x00003D3C File Offset: 0x00001F3C
	[Token(Token = "0x60000B6")]
	[Address(RVA = "0x4334C0", Offset = "0x4322C0", VA = "0x1804334C0")]
	private void UpdateVolumes(VolumeSettings settings)
	{
		BGM[] array = this.g_Music;
		int num = 0;
		int length = array.Length;
		if (num < length)
		{
			array[num].UpdateVolume(settings);
			num++;
		}
		BGM bgm = this.g_DeathBGM;
		int num2 = 0;
		if (bgm != num2)
		{
			this.g_DeathBGM.UpdateVolume(settings);
		}
	}

	// Token: 0x060000B7 RID: 183 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60000B7")]
	[Address(RVA = "0x432D80", Offset = "0x431B80", VA = "0x180432D80")]
	public void PlayBGM(int index, float playingTime = 0f)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060000B8 RID: 184 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60000B8")]
	[Address(RVA = "0x433240", Offset = "0x432040", VA = "0x180433240")]
	public void SwitchBGM(int index)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060000B9 RID: 185 RVA: 0x00003D98 File Offset: 0x00001F98
	[Token(Token = "0x60000B9")]
	[Address(RVA = "0x433010", Offset = "0x431E10", VA = "0x180433010")]
	public void PlayDeathBGM()
	{
		BGM bgm = this.g_DeathBGM;
		int num = 0;
		if (!(bgm == num))
		{
			this.StopBGM();
			int num2 = UnityEngine.Random.Range(0, 3);
			if (num2 == 0)
			{
				BGM bgm2 = this.g_DeathBGM;
				int num3 = 0;
				bgm2.PlayBGM((float)num3);
				return;
			}
			if (num2 == 0)
			{
				this.g_DeathBGM.PlayBGM(54f);
				return;
			}
			if (num2 == 1)
			{
				this.g_DeathBGM.PlayBGM(86f);
				return;
			}
		}
		else
		{
			Debug.Log("找不到死亡音樂");
		}
	}

	// Token: 0x060000BA RID: 186 RVA: 0x00003E18 File Offset: 0x00002018
	[Token(Token = "0x60000BA")]
	[Address(RVA = "0x433160", Offset = "0x431F60", VA = "0x180433160")]
	public void StopBGM()
	{
		BGM[] array = this.g_Music;
		int num = this.bgmIndex;
		int length = array.Length;
		if (num < length)
		{
			BGM bgm = array[num];
			int num2 = 0;
			if (!(bgm == num2))
			{
				BGM[] array2 = this.g_Music;
				int num3 = this.bgmIndex;
				array2[num3].StopBGM();
				this.bgmIndex = (int)((ulong)4294967295L);
			}
		}
	}

	// Token: 0x060000BB RID: 187 RVA: 0x00003E88 File Offset: 0x00002088
	[Token(Token = "0x60000BB")]
	[Address(RVA = "0x432C30", Offset = "0x431A30", VA = "0x180432C30")]
	private void OnDisable()
	{
		Game.OnVolumeSettingsChanged -= new Action(this.UpdateVolumes);
		BGM[] array = this.g_Music;
		if (array != 0)
		{
			int num = 0;
			int length = array.Length;
			if (num < length)
			{
				array[num].Dispose();
				num++;
			}
		}
		BGM bgm = this.g_DeathBGM;
		int num2 = 0;
		if (bgm != num2)
		{
			this.g_DeathBGM.Dispose();
		}
	}

	// Token: 0x060000BC RID: 188 RVA: 0x00003EF4 File Offset: 0x000020F4
	[Token(Token = "0x60000BC")]
	[Address(RVA = "0x3088F0", Offset = "0x3076F0", VA = "0x1803088F0")]
	public SceneBGMController()
	{
	}

	// Token: 0x0400010B RID: 267
	[FieldOffset(Offset = "0x18")]
	[Token(Token = "0x400010B")]
	public GameObject[] DeathBGM;

	// Token: 0x0400010C RID: 268
	[FieldOffset(Offset = "0x20")]
	[Token(Token = "0x400010C")]
	public GameObject[] BGMObject;

	// Token: 0x0400010D RID: 269
	[FieldOffset(Offset = "0x28")]
	[Token(Token = "0x400010D")]
	[SerializeField]
	private BGM g_DeathBGM;

	// Token: 0x0400010E RID: 270
	[FieldOffset(Offset = "0x30")]
	[Token(Token = "0x400010E")]
	[SerializeField]
	private BGM[] g_Music;

	// Token: 0x0400010F RID: 271
	[FieldOffset(Offset = "0x38")]
	[Token(Token = "0x400010F")]
	[SerializeField]
	private int bgmIndex;
}
