using System.Collections; using System.Collections.Generic; using UnityEngine; public class levelThirty : MonoBehaviour { public bool one; public bool two; public bool three; public bool four; public int actualOnOff;//为1时代表答案做错了 public GameObject badButton; public PanDuan UsingPanDuan; private void Start() { this.one = true; this.two = true; three = false; four = false; actualOnOff = 0; } /// /// 第一个主电 /// public void oneOnOff() { if (this.two) { this.actualOnOff = 1; } this.one = false; if (!one&&!two) { badButton.SetActive(true); } } /// /// 第一个配电 /// public void twoOnOff() { this.two = false; if (!one && !two) { badButton.SetActive(true); } } /// /// 第二个主电 /// public void threeOnOff() { if (this.four) { this.actualOnOff = 1; if (this.actualOnOff == 1) { UsingPanDuan.SetOne(false); Debug.LogError("设置选项为" + false); } else if (this.actualOnOff == 0) { UsingPanDuan.SetOne(true); } } this.three = true; } /// /// 第二个配电 /// public void fourOnOff() { this.four = true; if (this.three) { if (this.actualOnOff == 1) { UsingPanDuan.SetOne(false); Debug.LogError("设置选项为" + false); } else if (this.actualOnOff == 0) { UsingPanDuan.SetOne(true); } } } }