You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
1.4 KiB

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;
}
/// <summary>
/// 第一个主电
/// </summary>
public void oneOnOff()
{
if (this.two)
{
this.actualOnOff = 1;
}
this.one = false;
if (!one&&!two)
{
badButton.SetActive(true);
}
}
/// <summary>
/// 第一个配电
/// </summary>
public void twoOnOff()
{
this.two = false;
if (!one && !two)
{
badButton.SetActive(true);
}
}
/// <summary>
/// 第二个主电
/// </summary>
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;
}
/// <summary>
/// 第二个配电
/// </summary>
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);
}
}
}
}