86 lines
1.9 KiB
C#
86 lines
1.9 KiB
C#
|
using UnityEngine;
|
|||
|
using UnityEngine.UI;
|
|||
|
using System.Collections;
|
|||
|
using Games.Item;
|
|||
|
using System.Collections.Generic;
|
|||
|
using GCGame.Table;
|
|||
|
using Games.GlobeDefine;
|
|||
|
|
|||
|
public class GuanningStartLogic : UIControllerBase<GuanningStartLogic>
|
|||
|
{
|
|||
|
void OnEnable()
|
|||
|
{
|
|||
|
SetInstance(this);
|
|||
|
_StartImg.gameObject.SetActive(false);
|
|||
|
|
|||
|
if (GuanningAreaLogic.Instance())
|
|||
|
{
|
|||
|
GuanningAreaLogic.Instance().ShowMatchTip();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
void OnDisable()
|
|||
|
{
|
|||
|
SetInstance(null);
|
|||
|
}
|
|||
|
|
|||
|
public void CloseWindow()
|
|||
|
{
|
|||
|
UIManager.CloseUI(UIInfo.GuanningStartRoot);
|
|||
|
}
|
|||
|
|
|||
|
public static void ShowStartCountDown(int countDown)
|
|||
|
{
|
|||
|
if (!GuanningStartLogic.Instance())
|
|||
|
{
|
|||
|
UIManager.ShowUI(UIInfo.GuanningStartRoot, ShowUIOver, countDown);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
GuanningStartLogic.Instance().ShowCountDown(countDown);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public static void ShowUIOver(bool bSuccess, object param)
|
|||
|
{
|
|||
|
if (!GuanningStartLogic.Instance())
|
|||
|
return;
|
|||
|
|
|||
|
GuanningStartLogic.Instance().ShowCountDown((int)param);
|
|||
|
}
|
|||
|
|
|||
|
#region
|
|||
|
|
|||
|
public static float _SHOW_START_TIME = 1.5f;
|
|||
|
|
|||
|
public UIImgText _NumText;
|
|||
|
public Image _StartImg;
|
|||
|
public GameObject _NumPanel;
|
|||
|
|
|||
|
public void ShowCountDown(int countDown)
|
|||
|
{
|
|||
|
if (countDown > 0)
|
|||
|
{
|
|||
|
_NumPanel.gameObject.SetActive(true);
|
|||
|
_NumText.text = countDown.ToString();
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
_NumPanel.gameObject.SetActive(false);
|
|||
|
_StartImg.gameObject.SetActive(true);
|
|||
|
StartCoroutine(HideStartImg());
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public IEnumerator HideStartImg()
|
|||
|
{
|
|||
|
yield return new WaitForSeconds(_SHOW_START_TIME);
|
|||
|
|
|||
|
UIManager.ShowUI(UIInfo.GuanningAreaRoot);
|
|||
|
_StartImg.gameObject.SetActive(false);
|
|||
|
CloseWindow();
|
|||
|
}
|
|||
|
|
|||
|
#endregion
|
|||
|
}
|