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.

96 lines
2.7 KiB

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class DanXuan :BaseView
{
// Start is called before the first frame update
public int =-1;
public Toggle[] toggles1;
public Button[] buttons;
public GameObject next,myscene,nextscene;
public GameObject , ;
public Button btn_, btn_, btn_;
void Start()
{
toggles1 = GetComponentsInChildren<Toggle>();
for (int i = 0; i < toggles1.Length; i++)
{
int k = i;
toggles1[i].onValueChanged.AddListener((bool bo) => ToggleCtrl(bo, k));
}
for (int i = 0; i < buttons.Length; i++)
{
int k = i;
buttons[i].onClick.AddListener(()=>ButtonCtrl(k));
}
= GetChild(transform, "NoAnswerTip");
= GetChild(transform, "OverTip");
GameObject CtrlWnd= GetChild(transform, "CtrlWnd");
btn_ = GetChild<Button>(CtrlWnd.transform, "SubmitBtn");
btn_= GetChild<Button>(.transform, "OK");
// btn_已作答提交= GetChild<Button>(提交完毕.transform, "OK");
btn_.onClick.RemoveAllListeners();
btn_.onClick.RemoveAllListeners();
// btn_已作答提交.onClick.RemoveAllListeners();
AddListener(btn_, );
AddListener(btn_, );
// AddListener(btn_已作答提交, 确认提交);
}
// Update is called once per frame
void Update()
{
}
public void ()
{
if ( > 0)
{
//提交完毕.SetActive(true);
();
}
else
{
.SetActive(true);
}
}
public void ()
{
GameRoot.SubmitChoiceAnswer(Windows.Instance., Windows.Instance., );
//Windows.Instance.提交中.SetActive(true);
Windows.Instance.++;
gameObject.SetActive(false);
if (next != null)
{
next.SetActive(true);
}
if (nextscene != null)
{
nextscene.SetActive(true);
}
if (myscene != null)
{
myscene.SetActive(false);
}
if (next == null)
{
GameRoot.SubmitPassState(Windows.Instance., true);
GameRoot.ReturnMenu();
}
}
public void ToggleCtrl(bool bo,int id)
{
if (bo)
{ = id+1; }
}
public void ButtonCtrl(int id)
{
= id+1;
}
}