|
@@ -10,7 +10,7 @@ namespace GFGGame
|
|
|
public class LuckyBoxController
|
|
|
{
|
|
|
private GComponent _com;
|
|
|
- private UI_ComModel _comModel;
|
|
|
+ // private UI_ComModel _comModel;
|
|
|
private DressUpObjUI _dressUpObjUI;
|
|
|
private LuckyBoxCfg _luckyBoxCfg;
|
|
|
private const int _turnTime = 8;
|
|
@@ -26,10 +26,11 @@ namespace GFGGame
|
|
|
|
|
|
public void OnShown(int luckyBoxId)
|
|
|
{
|
|
|
- _comModel = UI_ComModel.Proxy(_com);
|
|
|
+ // _comModel = UI_ComModel.Proxy(_com);
|
|
|
_curTime = _turnTime;
|
|
|
_luckyBoxCfg = LuckyBoxCfgArray.Instance.GetCfg(luckyBoxId);
|
|
|
ChangeRes();
|
|
|
+ Timers.inst.Remove(UpdateTime);
|
|
|
Timers.inst.Add(_turnTime, 0, UpdateTime);
|
|
|
}
|
|
|
|
|
@@ -50,7 +51,7 @@ namespace GFGGame
|
|
|
|
|
|
private void ChangeRes()
|
|
|
{
|
|
|
-
|
|
|
+ UI_ComModel _comModel = UI_ComModel.Proxy(_com);
|
|
|
_comModel.m_loaBg.url = ResPathUtil.GetBgImgPath(_luckyBoxCfg.bgResArr[_bgIndex]);
|
|
|
if (_luckyBoxCfg.resArr.Length > 0)
|
|
|
{
|
|
@@ -85,13 +86,16 @@ namespace GFGGame
|
|
|
_comModel.m_holder.SetPosition(_luckyBoxCfg.posArr[_modelIndex][0], _luckyBoxCfg.posArr[_modelIndex][1], 1);
|
|
|
}
|
|
|
}
|
|
|
+ UI_ComModel.ProxyEnd();
|
|
|
}
|
|
|
public void OnHide()
|
|
|
{
|
|
|
_bgIndex = 0;
|
|
|
_modelIndex = 0;
|
|
|
_dressUpObjUI.ResetSceneObj(0, false, false, null, false);
|
|
|
+ UI_ComModel _comModel = UI_ComModel.Proxy(_com);
|
|
|
_comModel.m_loaRes.url = "";
|
|
|
+ UI_ComModel.ProxyEnd();
|
|
|
Timers.inst.Remove(UpdateTime);
|
|
|
}
|
|
|
|
|
@@ -102,7 +106,6 @@ namespace GFGGame
|
|
|
_dressUpObjUI.Dispose();
|
|
|
_dressUpObjUI = null;
|
|
|
}
|
|
|
- UI_ComModel.ProxyEnd();
|
|
|
}
|
|
|
}
|
|
|
}
|