using System;
using Cpp2IlInjected;
using UnityEngine;

// Token: 0x0200001D RID: 29
[Token(Token = "0x200001D")]
public class SceneBGMController : MonoBehaviour
{
	// Token: 0x060000B6 RID: 182 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60000B6")]
	[Address(RVA = "0x50C920", Offset = "0x50B920", VA = "0x18050C920")]
	public void Init()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060000B7 RID: 183 RVA: 0x00003C9C File Offset: 0x00001E9C
	[Token(Token = "0x60000B7")]
	[Address(RVA = "0x50D850", Offset = "0x50C850", VA = "0x18050D850")]
	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: 0x060000B8 RID: 184 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60000B8")]
	[Address(RVA = "0x50D110", Offset = "0x50C110", VA = "0x18050D110")]
	public void PlayBGM(int index, float playingTime = 0f)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060000B9 RID: 185 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x60000B9")]
	[Address(RVA = "0x50D5D0", Offset = "0x50C5D0", VA = "0x18050D5D0")]
	public void SwitchBGM(int index)
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x060000BA RID: 186 RVA: 0x00003CF8 File Offset: 0x00001EF8
	[Token(Token = "0x60000BA")]
	[Address(RVA = "0x50D3A0", Offset = "0x50C3A0", VA = "0x18050D3A0")]
	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: 0x060000BB RID: 187 RVA: 0x00003D78 File Offset: 0x00001F78
	[Token(Token = "0x60000BB")]
	[Address(RVA = "0x50D4F0", Offset = "0x50C4F0", VA = "0x18050D4F0")]
	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: 0x060000BC RID: 188 RVA: 0x00003DE8 File Offset: 0x00001FE8
	[Token(Token = "0x60000BC")]
	[Address(RVA = "0x50CFC0", Offset = "0x50BFC0", VA = "0x18050CFC0")]
	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: 0x060000BD RID: 189 RVA: 0x00003E54 File Offset: 0x00002054
	[Token(Token = "0x60000BD")]
	[Address(RVA = "0x328C40", Offset = "0x327C40", VA = "0x180328C40")]
	public SceneBGMController()
	{
	}

	// Token: 0x04000110 RID: 272
	[FieldOffset(Offset = "0x18")]
	[Token(Token = "0x4000110")]
	public GameObject[] DeathBGM;

	// Token: 0x04000111 RID: 273
	[FieldOffset(Offset = "0x20")]
	[Token(Token = "0x4000111")]
	public GameObject[] BGMObject;

	// Token: 0x04000112 RID: 274
	[FieldOffset(Offset = "0x28")]
	[Token(Token = "0x4000112")]
	[SerializeField]
	private BGM g_DeathBGM;

	// Token: 0x04000113 RID: 275
	[FieldOffset(Offset = "0x30")]
	[Token(Token = "0x4000113")]
	[SerializeField]
	private BGM[] g_Music;

	// Token: 0x04000114 RID: 276
	[FieldOffset(Offset = "0x38")]
	[Token(Token = "0x4000114")]
	[SerializeField]
	private int bgmIndex;
}
