using System;
using Cpp2IlInjected;
using UnityEngine;

// Token: 0x02000193 RID: 403
[Token(Token = "0x2000193")]
public class DoorSwitch : PassiveEvent
{
	// Token: 0x06001362 RID: 4962 RVA: 0x0002BD5C File Offset: 0x00029F5C
	[Token(Token = "0x6001362")]
	[Address(RVA = "0x1594020", Offset = "0x1593020", VA = "0x181594020", Slot = "4")]
	protected override void Start()
	{
		base..ctor();
		BoxCollider bc = this.BC;
		int num = 0;
		if (!(bc == num))
		{
			this.BC.isTrigger = true;
		}
		Debug.LogError("找不到碰撞");
		Animator ani = this.Ani;
		int num2 = 0;
		if (ani == num2)
		{
			Debug.LogError("找不到動畫");
		}
		GameObject seobject = this.SEObject;
		Transform transform = base.transform;
		SoundEffect soundEffectOfPrefabs = Common.GetSoundEffectOfPrefabs(seobject, transform);
		this.g_SE = soundEffectOfPrefabs;
		this.g_fReciprocal = 2f;
	}

	// Token: 0x06001363 RID: 4963 RVA: 0x0002BDEC File Offset: 0x00029FEC
	[Token(Token = "0x6001363")]
	[Address(RVA = "0x1594210", Offset = "0x1593210", VA = "0x181594210", Slot = "6")]
	protected override void Update()
	{
		base.Update();
		if (!this.g_bClose && !this.BC.enabled)
		{
			float num = this.g_fReciprocal;
			int num2 = 0;
			if (num > (float)num2)
			{
				this.g_fReciprocal = num;
				SceneEvent[] openEvent = this.OpenEvent;
				int num3 = 0;
				if (openEvent != 0 && num3 < openEvent.Length)
				{
					SceneEvent sceneEvent = openEvent[num3];
					int num4 = 0;
					if (sceneEvent != num4)
					{
						this.OpenEvent[num3].OpenEvent();
					}
					SceneEvent[] openEvent2 = this.OpenEvent;
					num3++;
				}
				SceneEvent[] releaseEvent = this.ReleaseEvent;
				if (releaseEvent != 0 && num3 < releaseEvent.Length)
				{
					SceneEvent sceneEvent2 = releaseEvent[num3];
					int num5 = 0;
					if (sceneEvent2 != num5)
					{
						this.ReleaseEvent[num3].ReleaseEvent();
					}
					SceneEvent[] releaseEvent2 = this.ReleaseEvent;
					num3++;
					while (releaseEvent2 != 0)
					{
					}
				}
				OpenDoor[] door = this.Door;
				if (door != 0 && num3 < door.Length)
				{
					OpenDoor openDoor = door[num3];
					int num6 = 0;
					if (openDoor != num6)
					{
						this.Door[num3].SwitchOnDoor();
					}
					OpenDoor[] door2 = this.Door;
					num3++;
					while (door2 != 0)
					{
					}
				}
				this.g_bClose = true;
			}
		}
	}

	// Token: 0x06001364 RID: 4964 RVA: 0x0002BF30 File Offset: 0x0002A130
	[Token(Token = "0x6001364")]
	[Address(RVA = "0x15941A0", Offset = "0x15931A0", VA = "0x1815941A0")]
	public void SwitchOn()
	{
		BoxCollider bc = this.BC;
		int num = 0;
		bc.enabled = num != 0;
		Animator ani = this.Ani;
		int num2 = 0;
		ani.CrossFade("SwitchOn", 0.025f, num2);
	}

	// Token: 0x06001365 RID: 4965 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001365")]
	[Address(RVA = "0x1593CB0", Offset = "0x1592CB0", VA = "0x181593CB0")]
	public void SaveSwitchOn()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001366 RID: 4966 RVA: 0x0002BF70 File Offset: 0x0002A170
	[Token(Token = "0x6001366")]
	[Address(RVA = "0x1593A20", Offset = "0x1592A20", VA = "0x181593A20")]
	public void AniPlaySwitchOnSE()
	{
		SoundEffect soundEffect = this.g_SE;
		int num = 0;
		if (soundEffect != num)
		{
			this.g_SE.PlayRandom(1f, 1f);
		}
	}

	// Token: 0x06001367 RID: 4967 RVA: 0x0002BFAC File Offset: 0x0002A1AC
	[Token(Token = "0x6001367")]
	[Address(RVA = "0x1593C10", Offset = "0x1592C10", VA = "0x181593C10")]
	public void ResetSwitch()
	{
		BoxCollider bc = this.BC;
		this.g_fReciprocal = 2f;
		bc.enabled = true;
		if (base.gameObject.activeInHierarchy)
		{
			Animator ani = this.Ani;
			int num = 0;
			ani.CrossFade("Idle", 1f, num);
		}
		this.g_bClose = false;
	}

	// Token: 0x06001368 RID: 4968 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x6001368")]
	[Address(RVA = "0x1593AB0", Offset = "0x1592AB0", VA = "0x181593AB0")]
	public void Close()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x06001369 RID: 4969 RVA: 0x0002C008 File Offset: 0x0002A208
	[Token(Token = "0x6001369")]
	[Address(RVA = "0x1594000", Offset = "0x1593000", VA = "0x181594000", Slot = "7")]
	public override void SetTimeScale(float fScaleTime)
	{
		this.Ani.speed = fScaleTime;
	}

	// Token: 0x0600136A RID: 4970 RVA: 0x000020D3 File Offset: 0x000002D3
	[Token(Token = "0x600136A")]
	[Address(RVA = "0x1593B60", Offset = "0x1592B60", VA = "0x181593B60")]
	private void OnEnable()
	{
		throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
	}

	// Token: 0x0600136B RID: 4971 RVA: 0x0002C028 File Offset: 0x0002A228
	[Token(Token = "0x600136B")]
	[Address(RVA = "0x41ED30", Offset = "0x41DD30", VA = "0x18041ED30")]
	public DoorSwitch()
	{
	}

	// Token: 0x04001D3D RID: 7485
	[FieldOffset(Offset = "0x20")]
	[Token(Token = "0x4001D3D")]
	public Animator Ani;

	// Token: 0x04001D3E RID: 7486
	[FieldOffset(Offset = "0x28")]
	[Token(Token = "0x4001D3E")]
	public BoxCollider BC;

	// Token: 0x04001D3F RID: 7487
	[FieldOffset(Offset = "0x30")]
	[Token(Token = "0x4001D3F")]
	public GameObject SEObject;

	// Token: 0x04001D40 RID: 7488
	[FieldOffset(Offset = "0x38")]
	[Token(Token = "0x4001D40")]
	public SceneEvent[] OpenEvent;

	// Token: 0x04001D41 RID: 7489
	[FieldOffset(Offset = "0x40")]
	[Token(Token = "0x4001D41")]
	public SceneEvent[] ReleaseEvent;

	// Token: 0x04001D42 RID: 7490
	[FieldOffset(Offset = "0x48")]
	[Token(Token = "0x4001D42")]
	public OpenDoor[] Door;

	// Token: 0x04001D43 RID: 7491
	[FieldOffset(Offset = "0x50")]
	[Token(Token = "0x4001D43")]
	private float g_fReciprocal;

	// Token: 0x04001D44 RID: 7492
	[FieldOffset(Offset = "0x58")]
	[Token(Token = "0x4001D44")]
	private SoundEffect g_SE;

	// Token: 0x04001D45 RID: 7493
	[FieldOffset(Offset = "0x60")]
	[Token(Token = "0x4001D45")]
	private bool g_bClose;
}
