// 开场动画 public void ShowKaiChangGifView() { System.Action <Object> handler = (asset) => { if (asset != null) { GameObject gifView = (GameObject)GameObject.Instantiate(asset); NGUIUtility.SetParent(waitingParentT, gifView.transform); } }; StartCoroutine(BundleMgr.CreateObject(kResource.View, "KaiChangView", "KaiChangView", handler)); }
// 战斗结果 public void ShowBattleRecordResultView(bool bresult, Data_MapBattle_R.SetData data) { System.Action <Object> handler = (asset) => { if (asset != null) { GameObject resultViewObject = (GameObject)GameObject.Instantiate(asset); JiesuanView resultView = resultViewObject.GetComponent <JiesuanView>(); NGUIUtility.SetParent(waitingParentT, resultViewObject.transform); resultView.show(bresult, data); } }; StartCoroutine(BundleMgr.CreateObject(kResource.View, "JiesuanView", "JiesuanView", handler)); }
// 任务 public void ShowRenwuView(MapJson mapjson) { System.Action <Object> handler = (asset) => { if (asset != null) { GameObject renwuViewObject = (GameObject)GameObject.Instantiate(asset); RenwuView renwuView = renwuViewObject.GetComponent <RenwuView>(); renwuView.show(mapjson); NGUIUtility.SetParent(waitingParentT, renwuViewObject.transform); } }; StartCoroutine(BundleMgr.CreateObject(kResource.View, "RenwuView", "RenwuView", handler)); }
// 角色创建面板 public void ShowCreateRoleView() { if (m_SelectRoleView == null) { System.Action <Object> handler = (asset) => { if (asset != null) { GameObject selectRoleView = (GameObject)GameObject.Instantiate(asset); m_SelectRoleView = selectRoleView.GetComponent <SelectRoleView>(); NGUIUtility.SetParent(waitingParentT, selectRoleView.transform); } }; StartCoroutine(BundleMgr.CreateObject(kResource.View, "SelectRoleView", "SelectRoleView", handler)); } }
// 战斗记录 public void ShowBattleRecordView(Data_MapBattle_R data) { if (m_BattleRecordView == null) { System.Action <Object> handler = (asset) => { if (asset != null) { GameObject battleRecordViewObject = (GameObject)GameObject.Instantiate(asset); m_BattleRecordView = battleRecordViewObject.GetComponent <BattleRecordView>(); m_BattleRecordView.show(data); NGUIUtility.SetParent(waitingParentT, battleRecordViewObject.transform); } }; StartCoroutine(BundleMgr.CreateObject(kResource.View, "BattleRecordView", "BattleRecordView", handler)); } }
// 显示输入 输入角色名字 等情况 public void ShowInput(System.Action <string> callback) { if (m_InoutBoxView == null) { System.Action <Object> handler = (asset) => { if (asset != null) { GameObject objInputBox = (GameObject)GameObject.Instantiate(asset); // 创建输入界面 显示 m_InoutBoxView = objInputBox.GetComponent <InoutBoxView>(); NGUIUtility.SetParent(waitingParentT, objInputBox.transform); m_InoutBoxView.onShow(callback); } }; StartCoroutine(BundleMgr.CreateObject(kResource.View, "InputBoxView", "InputBoxView", handler)); } }
private IEnumerator _ShowWaiting() { yield return(new WaitForSeconds(1.0f)); { if (m_WaitingView == null && waitingView != null) { System.Action <Object> handler = (asset) => { if (asset != null) { m_WaitingView = (GameObject)GameObject.Instantiate(asset); NGUIUtility.SetParent(waitingParentT, m_WaitingView.transform); } }; StartCoroutine(BundleMgr.CreateObject(kResource.Common, "WaitingView", "WaitingView", handler)); } } }
// 开启协程 创建登录视图 IEnumerator _CreateLoginView() { yield return(null); // 加载完之后需要执行这个回调 handler System.Action <Object> handler = (asset) => { if (asset != null) { GameObject dengluObject = (GameObject)GameObject.Instantiate(asset); // 登录视图 m_DengluView = dengluObject.GetComponent <DengluView>(); NGUIUtility.SetParent(waitingParentT, dengluObject.transform); // waitingParentT => Anchor AudioManager.PlayLoopSound(bgAudio); // 播放音乐 } HideWaiting(); }; ShowWaiting(); StartCoroutine(BundleMgr.CreateObject(kResource.View, "DengluView", "DengluView", handler)); }
public void ShowWarn(int iTitle, string strMsg, System.Action callback) { string sTitle = LanguageMgr.GetString(iTitle); Debug.LogError(strMsg); if (m_MessageBoxView == null) { System.Action <Object> handler = (asset) => { if (asset != null) { GameObject objMsgBox = (GameObject)GameObject.Instantiate(asset); // 创建弹窗 显示 m_MessageBoxView = objMsgBox.GetComponent <MessageBoxView>(); NGUIUtility.SetParent(waitingParentT, objMsgBox.transform); m_MessageBoxView.show(sTitle, strMsg, callback); } }; StartCoroutine(BundleMgr.CreateObject(kResource.View, "MessageBoxView", "MessageBoxView", handler)); } }
public void ShowMainView() { if (m_MainView == null) // 创建 { System.Action <Object> handler = (asset) => { if (asset != null) { GameObject mainView = (GameObject)GameObject.Instantiate(asset); m_MainView = mainView.GetComponent <MainView>(); NGUIUtility.SetParent(waitingParentT, mainView.transform); m_MainView.InitMap(); m_MainView.GetMapData(); } }; StartCoroutine(BundleMgr.CreateObject(kResource.View, "MainView", "MainView", handler)); } else // 是否需要刷新 玩家id 发送到服务端 { if (MainPlayer.proMain.bNeedRefresh) { ShowWaiting(); // 这里等待是为了下面数据的发送吗??? Data_PlayerStat data = new Data_PlayerStat() { characterId = MainPlayer.proMain.iCharacterId }; Globals.It.SendMsg(data, Const_ICommand.PlayerStat); } else // 刷新玩家 数据 { m_MainView.gameObject.SetActive(true); m_MainView.RefreshMapStat(); m_MainView.RefreshPlayerStat(); Globals.It.HideWaiting(); } } }