//销毁自身<释放内存> void DestoryMe() { Instance = null; if (Exit != null) { Exit(gameObject.name); } Destroy(gameObject); }
//销毁自身<释放内存> void DestoryMe() { Instance = null; if (Exit != null) { Exit(gameObject.name); } Destroy(gameObject); if (PVEDownloadCartoonController.Instance != null) { PVEDownloadCartoonController.Instance.ClosePanel(); } }
public static JCPVEPlotController OpenUI() { if (Instance == null) { Object prefab = PrefabLoader.loadFromPack("JC/PVPMapController"); if (prefab != null) { GameObject obj = Instantiate(prefab) as GameObject; RED.AddChild(obj, DBUIController.mDBUIInstance._bottomRoot); Instance = obj.GetComponent <JCPVEPlotController>(); } } return(Instance); }
public void OnBtnClick(string btnName,bool isBtnClick = false) { switch(btnName) { case "PVEType_Plot": Core.Data.newDungeonsManager .curFightingFBType = "PVEType_Plot"; JCPVEPlotController.OpenUI().Exit = CallBackBtnReturn; gameObject.SetActive (false); break; case "PVEType_Exp": Core.Data.newDungeonsManager .curFightingFBType = "PVEType_Exp"; JCPVEExpOrGem.OpenUI(); break; case "PVEType_Skill": if(!JCPVETimerManager.Instance.isSkillFBCoding) { NewDungeonsManager ndm = Core.Data.newDungeonsManager; if(ndm.explorDoors != null && ndm.explorDoors.skill != null) { if(ndm.explorDoors.skill.count != ndm.explorDoors.skill.passCount) { Core.Data.newDungeonsManager .curFightingFBType = "PVEType_Skill"; JCPVESkillController.OpenUI().Exit = CallBackBtnReturn; gameObject.SetActive (false); } } } if(isBtnClick) AutoShowBuyBox(1); break; case "PVEType_FightSoul": if(!JCPVETimerManager.Instance.isFightSoulFBCoding) { NewDungeonsManager ndm = Core.Data.newDungeonsManager; if(ndm.explorDoors != null && ndm.explorDoors.souls != null) { if(ndm.explorDoors.souls.count != ndm.explorDoors.souls.passCount) { Core.Data.newDungeonsManager .curFightingFBType = "PVEType_FightSoul"; JCPVEFightSoulController.OpenUI().Exit = CallBackBtnReturn; gameObject.SetActive (false); } } } if(isBtnClick) AutoShowBuyBox(2); break; case "BackButton": { gameObject.SetActive (false); if (PVEDownloadCartoonController.Instance != null) { PVEDownloadCartoonController.Instance.ClosePanel (); } DBUIController.mDBUIInstance.ShowFor2D_UI (false); TopMenuUI.DestroyUI (); break; } } }