fix:1、修复bug
This commit is contained in:
@@ -21,7 +21,7 @@ namespace ChillConnect
|
||||
{
|
||||
uiInfo.packageName = "Arrow_game";
|
||||
uiInfo.assetName = "com_tips";
|
||||
uiInfo.layerType = UILayerType.Loading;
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
uiInfo.isNeedOpenAnim = true;
|
||||
uiInfo.isNeedCloseAnim = true;
|
||||
@@ -36,6 +36,9 @@ namespace ChillConnect
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, true);
|
||||
|
||||
CommonHelper.FadeOut(ui);
|
||||
|
||||
HallManager.Instance.UpdateSecondEvent -= UpdateCd;
|
||||
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
@@ -43,12 +46,19 @@ namespace ChillConnect
|
||||
ui = baseUI as com_tips;
|
||||
}
|
||||
|
||||
private int state_;
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, false);
|
||||
|
||||
if (args != null)
|
||||
{
|
||||
InitView((int)args);
|
||||
state_ = (int)args + 5;
|
||||
}
|
||||
|
||||
HallManager.Instance.UpdateSecondEvent += UpdateCd;
|
||||
UpdateCd();
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
@@ -79,7 +89,7 @@ namespace ChillConnect
|
||||
if (isSuccess)
|
||||
{
|
||||
Debug.Log($"isSuccess tips state = {state} ");
|
||||
|
||||
GameHelper.SetWatchCd(state_);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.UseProps, state);
|
||||
CtrlCloseUI();
|
||||
}
|
||||
@@ -88,5 +98,24 @@ namespace ChillConnect
|
||||
|
||||
ui.btn_close.SetClick(CtrlCloseUI);
|
||||
}
|
||||
|
||||
|
||||
private void UpdateCd()
|
||||
{
|
||||
var btnWatch = ui.btn_watch ;
|
||||
// Debug.Log($"DataMgr.NewWatchCd.Value[state_ + 2]==={DataMgr.NewWatchCd.Value[state_ + 2]}");
|
||||
if (DataMgr.NewWatchCd.Value[state_] > Convert.ToInt32(GameHelper.GetNowTime()))
|
||||
{
|
||||
btnWatch.enabled = false;
|
||||
btnWatch.can.selectedIndex = 1;
|
||||
btnWatch.text.text = CommonHelper.TimeFormat(DataMgr.NewWatchCd.Value[state_] - Convert.ToInt32(GameHelper.GetNowTime()), CountDownType.Hour);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.btn_watch.enabled = true;
|
||||
btnWatch.can.selectedIndex = 0;
|
||||
btnWatch.text.text = "Use Item";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user