133 lines
5.5 KiB
C#
133 lines
5.5 KiB
C#
using CG.Framework;
|
||
using CG.UTility;
|
||
using System.Collections;
|
||
using System.Collections.Generic;
|
||
using UnityEngine;
|
||
using UnityEngine.UI;
|
||
/*******************************************************************************
|
||
*Create By CG
|
||
*Function
|
||
*******************************************************************************/
|
||
namespace ZXK.LouDiXvMuNiu
|
||
{
|
||
public class AppSettingPanel : UIBase
|
||
{
|
||
private GameObject _modelNameGeo = null;
|
||
private Button _homeBtn = null;
|
||
private Button _scoreBtn = null;
|
||
private Button _desBtn = null;
|
||
private Button _setBtn = null;
|
||
private Button _closeBtn = null;
|
||
private Button _backBtn = null;
|
||
|
||
protected override void Awake()
|
||
{
|
||
base.Awake();
|
||
_modelNameGeo = GetWedage("TitleImg_N");
|
||
_homeBtn = GetWedage("homeBtn_N").GetComponent<Button>();
|
||
_scoreBtn = GetWedage("scoreBtn_N").GetComponent<Button>();
|
||
_desBtn = GetWedage("desBtn_N").GetComponent<Button>();
|
||
_setBtn = GetWedage("setBtn_N").GetComponent<Button>();
|
||
_closeBtn = GetWedage("closeBtn_N").GetComponent<Button>();
|
||
_backBtn = GetWedage("backBtn_N").GetComponent<Button>();
|
||
InitClick();
|
||
}
|
||
|
||
private void FixedUpdate()
|
||
{
|
||
System.Type curType = GameManager.Instance._StateContext.GetState();
|
||
switch (curType.Name)
|
||
{
|
||
case "HomeState":
|
||
_modelNameGeo.SetActive(false);
|
||
_homeBtn.gameObject.SetActive(false);
|
||
_scoreBtn.gameObject.SetActive(false);
|
||
_desBtn.gameObject.SetActive(false);
|
||
_setBtn.gameObject.SetActive(false);
|
||
_closeBtn.gameObject.SetActive(false);
|
||
_backBtn.gameObject.SetActive(false);
|
||
break;
|
||
case "ModelSelectState":
|
||
_modelNameGeo.SetActive(false);
|
||
_homeBtn.gameObject.SetActive(false);
|
||
_scoreBtn.gameObject.SetActive(false);
|
||
_desBtn.gameObject.SetActive(false);
|
||
_setBtn.gameObject.SetActive(true);
|
||
_closeBtn.gameObject.SetActive(true);
|
||
_backBtn.gameObject.SetActive(true);
|
||
break;
|
||
case "TrainState":
|
||
_modelNameGeo.SetActive(true);
|
||
_modelNameGeo.transform.Find("Text").GetComponent<Text>().text = GameManager.Instance._CurModelType;
|
||
_homeBtn.gameObject.SetActive(true);
|
||
_scoreBtn.gameObject.SetActive(false);
|
||
_desBtn.gameObject.SetActive(true);
|
||
_setBtn.gameObject.SetActive(true);
|
||
_closeBtn.gameObject.SetActive(true);
|
||
_backBtn.gameObject.SetActive(true);
|
||
break;
|
||
case "ExamState":
|
||
_modelNameGeo.SetActive(true);
|
||
_modelNameGeo.transform.Find("Text").GetComponent<Text>().text = GameManager.Instance._CurModelType;
|
||
_homeBtn.gameObject.SetActive(true);
|
||
_scoreBtn.gameObject.SetActive(true);
|
||
_desBtn.gameObject.SetActive(true);
|
||
_setBtn.gameObject.SetActive(true);
|
||
_closeBtn.gameObject.SetActive(true);
|
||
_backBtn.gameObject.SetActive(true);
|
||
break;
|
||
}
|
||
}
|
||
|
||
private void InitClick()
|
||
{
|
||
_homeBtn.onClick.AddListener(() =>
|
||
{
|
||
GameManager.Instance._StateContext.SetState(
|
||
new HomeState(GameManager.Instance._StateContext));
|
||
});
|
||
_scoreBtn.onClick.AddListener(() =>
|
||
{
|
||
PopUpMng._TriAble = false;
|
||
UI_Manage.Instance.ShowPanel("ScoreDataPanel", System.Type.GetType("ZXK.LouDiXvMuNiu.ScoreDataPanel"), UIGroup.Tip);
|
||
});
|
||
_desBtn.onClick.AddListener(() =>
|
||
{
|
||
PopUpMng._TriAble = false;
|
||
UI_Manage.Instance.ShowPanel("ExplainContainPanel", System.Type.GetType("ZXK.LouDiXvMuNiu.ExplainContainPanel"), UIGroup.Tip);
|
||
});
|
||
_setBtn.onClick.AddListener(() =>
|
||
{
|
||
PopUpMng._TriAble = false;
|
||
UI_Manage.Instance.ShowPanel("VolumeTranSettingPanel", System.Type.GetType("ZXK.LouDiXvMuNiu.VolumeTranSettingPanel"), UIGroup.Tip);
|
||
});
|
||
_closeBtn.onClick.AddListener(() =>
|
||
{
|
||
PopUpMng.PopConBox("<22><>ʾ", "<22>Ƿ<EFBFBD><C7B7>ر<EFBFBD><D8B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><>", "<22><>", () =>
|
||
{
|
||
UtilitiesMng.CustomQuit();
|
||
});
|
||
});
|
||
_backBtn.onClick.AddListener(ReturnExit);
|
||
}
|
||
|
||
private void ReturnExit()
|
||
{
|
||
System.Type curType = GameManager.Instance._StateContext.GetState();
|
||
switch (curType.Name)
|
||
{
|
||
case "ModelSelectState":
|
||
GameManager.Instance._StateContext.SetState(
|
||
new HomeState(GameManager.Instance._StateContext));
|
||
break;
|
||
case "TrainState":
|
||
case "ExamState":
|
||
PopUpMng.PopConBox("<22><>ʾ", "<22>Ƿ<EFBFBD><C7B7>˳<EFBFBD><CBB3><EFBFBD>ǰģ<C7B0>飿", "<22><>", "<22><>", () => {
|
||
GameManager.Instance._StateContext.SetState(
|
||
new ModelSelectState(GameManager.Instance._StateContext));
|
||
});
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
} |