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.

66 lines
1.4 KiB

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Step2_3 : MonoBehaviour
{
public Animator greenMan;
public Text State;
public static int rand;//题目随机
//玩家选择的答案
int answer=-1;
public ErrorTip errTip;
private void Awake()
{
EventManager.Instance.register("Question", Question);
}
private void OnEnable()
{
Obstacle();
}
void Obstacle()
{
if (Level2Manager.Instance.isHasHX)
{
State.text = "正常";
}
else
{
State.text = "不正常";
}
}
public void Question(params object[] data) {
answer = (int)data[0];
}
public void PanDuan() {
if (rand == 0)
{
if (answer == 2)
{
greenMan.SetTrigger("Call");
errTip.CloseTip();
gameObject.SetActive(false);
}
else {
errTip.InitThis("答案选择错误,请重试");
}
}
else if (rand == 1)
{
if (answer == 2)
{
greenMan.SetTrigger("Call");
errTip.CloseTip();
gameObject.SetActive(false);
}
else {
errTip.InitThis("答案选择错误,请重试");
}
}
}
}