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.
80 lines
2.2 KiB
80 lines
2.2 KiB
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using UnityEngine.EventSystems;
|
|
public class PanDuan : BaseView
|
|
{
|
|
|
|
public bool[] 选项=new bool[1];
|
|
public int index;
|
|
//public GameObject 提交完毕;
|
|
public GameObject next;
|
|
public Button btn_提交;
|
|
void Start()
|
|
{
|
|
if (选项.Length == 0)
|
|
{
|
|
选项 = new bool[] { false };
|
|
}
|
|
//GameObject CtrlWnd = GetChild(transform, "CtrlWnd");
|
|
//btn_提交 = GetChild<Button>(CtrlWnd.transform, "SubmitBtn");
|
|
// btn_已作答提交 = GetChild<Button>(提交完毕.transform, "OK");
|
|
|
|
btn_提交.onClick.RemoveAllListeners();
|
|
// btn_已作答提交.onClick.RemoveAllListeners();
|
|
|
|
AddListener(btn_提交, 确认提交);
|
|
//AddListener(btn_已作答提交, 确认提交);
|
|
}
|
|
|
|
public void 确认提交()
|
|
{
|
|
GameRoot.SubmitOprerationAnswer(Windows.Instance.关卡, Windows.Instance.题号, 选项);
|
|
// Windows.Instance.提交中.SetActive(true);
|
|
Windows.Instance.题号++;
|
|
//gameObject.SetActive(false);
|
|
|
|
if (next==null)
|
|
{
|
|
gameObject.SetActive(true);
|
|
GameRoot.SubmitPassState(Windows.Instance.关卡, true);
|
|
remake.a = 0;
|
|
remakeTwo.a = 0;
|
|
GameRoot.ReturnMenu();
|
|
//提交完毕.gameObject.SetActive(true);
|
|
}
|
|
}
|
|
public void SetButton(bool bo)
|
|
{
|
|
选项[index] = bo;
|
|
index++;
|
|
Debug.LogError("设置选项为" + bo);
|
|
}
|
|
public void SetButtonOne(bool bo)
|
|
{
|
|
if (EventSystem.current.currentSelectedGameObject.GetComponent<Toggle>() != null)
|
|
{
|
|
if (EventSystem.current.currentSelectedGameObject.GetComponent<Toggle>().isOn)
|
|
{
|
|
选项[index] = bo;
|
|
if (bo)
|
|
{ Debug.LogError("设置选项为" + bo); }
|
|
}
|
|
}
|
|
else
|
|
{
|
|
选项[index] = bo;
|
|
if (bo)
|
|
{ Debug.LogError("设置选项为" + bo); }
|
|
}
|
|
}
|
|
public void SetOne(bool bo)
|
|
{
|
|
选项[index] = bo;
|
|
if (bo)
|
|
{ Debug.LogError("设置选项为" + bo); }
|
|
}
|
|
|
|
}
|