83 lines
2.3 KiB
C#
83 lines
2.3 KiB
C#
using CG.Framework;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
/*******************************************************************************
|
|
*Create By CG
|
|
*Function
|
|
*******************************************************************************/
|
|
namespace ZXK.LouDiXvMuNiu
|
|
{
|
|
public class ExplainContainPanel : UIBase
|
|
{
|
|
private Toggle _trainTog = null;
|
|
private Toggle _handlerTog = null;
|
|
private GameObject _trainGeo = null;
|
|
private GameObject _handlerGeo = null;
|
|
private Button _closeBtn = null;
|
|
private Toggle _popLoop = null;
|
|
|
|
public bool _IsFirstEnter = false;
|
|
public int _clickNumber = 0;
|
|
|
|
protected override void Awake()
|
|
{
|
|
base.Awake();
|
|
_trainTog = GetWedage("TrainingInstruction_N").GetComponent<Toggle>();
|
|
_handlerTog = GetWedage("OperationInstruction_N").GetComponent<Toggle>();
|
|
_trainGeo = GetWedage("TrainExplainBG_N");
|
|
_handlerGeo = GetWedage("HandlerExplainBG_N");
|
|
_closeBtn = GetWedage("CloseBtn_N").GetComponent<Button>();
|
|
_popLoop = GetWedage("LoopPopSet_N").GetComponent<Toggle>();
|
|
InitUIState();
|
|
CG.UTility.PopUpMng._TriAble = false;
|
|
_clickNumber = 0;
|
|
_popLoop.isOn = GameManager.Instance._loopPopExplain;
|
|
}
|
|
|
|
private void InitUIState()
|
|
{
|
|
_popLoop.onValueChanged.AddListener((isOn) =>
|
|
{
|
|
GameManager.Instance._loopPopExplain = isOn;
|
|
});
|
|
_trainTog.onValueChanged.AddListener((isOn) =>
|
|
{
|
|
_trainGeo.SetActive(isOn);
|
|
if (isOn)
|
|
_clickNumber++;
|
|
});
|
|
_handlerTog.onValueChanged.AddListener((isOn) =>
|
|
{
|
|
_handlerGeo.SetActive(isOn);
|
|
if (isOn)
|
|
_clickNumber++;
|
|
});
|
|
_closeBtn.onClick.AddListener(() =>
|
|
{
|
|
if (_IsFirstEnter)
|
|
{
|
|
if (_clickNumber > 0)
|
|
{
|
|
UI_Manage.Instance.ClosePanel("ExplainContainPanel");
|
|
CG.UTility.PopUpMng._TriAble = true;
|
|
}
|
|
else {
|
|
_trainTog.isOn = false;
|
|
_handlerTog.isOn = true;
|
|
_clickNumber++;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
UI_Manage.Instance.ClosePanel("ExplainContainPanel");
|
|
CG.UTility.PopUpMng._TriAble = true;
|
|
}
|
|
|
|
});
|
|
_trainTog.isOn = true;
|
|
_handlerTog.isOn = false;
|
|
}
|
|
}
|
|
} |