public void SetTipImg(int mark) { string texName; switch (mark) { case 1: texName = "fb-dc"; break; case 2: texName = "fb-db"; break; case 3: texName = "fb-da"; break; case 4: texName = "fb-ds"; break; default: texName = "fb-dc"; break; } if (GetTexture("BattlePassCardListUICardListTipImg").mainTexture.name != texName) { MFUIResourceManager.GetSingleton().LoadResource(ID, string.Concat(texName, ".png"), (obj) => { SetTexture("BattlePassCardListUICardListTipImg", (Texture)obj); }); } }
public void SetGrade(int grade) { string texName; switch (grade) { case 0: texName = "fb-ds"; break; case 1: texName = "fb-da"; break; case 2: texName = "fb-db"; break; default: texName = "fb-dc"; break; } if (GetTexture("NewBattleRewardUIGrade").mainTexture.name != texName) { MFUIResourceManager.GetSingleton().LoadResource(ID, string.Concat(texName, ".png"), (obj) => { SetTexture("NewBattleRewardUIGrade", (Texture)obj); }); } }
private void RegisterGameObject(MFUIManager.MFUIID id, string path, string goName, bool preLoad = false) { if (!m_listResPathToPoolUnit.ContainsKey(path)) { List <MFUIGameObjectPoolUnit> listUnit = new List <MFUIGameObjectPoolUnit>(); m_listResPathToPoolUnit.Add(path, listUnit); MFUIResourceManager.GetSingleton().LoadInstance(id, path, goName, preLoad); } else { //Debug.LogError("LoadResouce " + path); List <MFUIGameObjectPoolUnit> listUnit = m_listResPathToPoolUnit[path]; for (int i = 0; i < listUnit.Count; ++i) { if (listUnit[i].isFree) { listUnit[i].isFree = false; listUnit[i].poolUnit.name = goName; MFUIGameObjectPool.GetSingleton().ResourceLoaded(goName); return; } } MFUIResourceManager.GetSingleton().LoadInstance(id, path, goName, preLoad); } }
public static MFUIResourceManager GetSingleton() { if (m_singleton == null) { m_singleton = new MFUIResourceManager(); } return m_singleton; }
public static MFUIResourceManager GetSingleton() { if (m_singleton == null) { m_singleton = new MFUIResourceManager(); } return(m_singleton); }
public void ReleaseRuneUI(GameObject go) { if (MFUIGameObjectPool.GetSingleton().m_listResPathToPoolUnit.ContainsKey("RuneUI.prefab")) { MFUIGameObjectPool.GetSingleton().m_listResPathToPoolUnit.Remove("RuneUI.prefab"); } MFUIResourceManager.GetSingleton().ReleasePreLoadResource(MFUIID.RuneUI); GameObject.Destroy(go); ReleaseUI(MFUIID.RuneUI); }
//public void DetachAllBasedUI(MFUIID id) //{ // Debug.LogError(DictUIBaseIDToTargetID.Count); // foreach (var item in DictUIBaseIDToTargetID) // { // Debug.LogError(item.Key + " " + item.Value[0]); // } // if (DictUIBaseIDToTargetID.ContainsKey(id)) // { // for (int i = 0; i < DictUIBaseIDToTargetID[id].Count; ++i) // { // Debug.LogError(DictUIIDToOBj[DictUIBaseIDToTargetID[id][i]].name+" @@@@@@@@@@@@@@@@@@@@"); // DictUIIDToOBj[DictUIBaseIDToTargetID[id][i]].GetComponentsInChildren<MFUIUnit>(true)[0].Hide(); // } // DictUIBaseIDToTargetID.Remove(id); // } //} //填坑函数 public void ReleaseDragonUI(GameObject go) { if (MFUIGameObjectPool.GetSingleton().m_listResPathToPoolUnit.ContainsKey("DragonUI.prefab")) { MFUIGameObjectPool.GetSingleton().m_listResPathToPoolUnit.Remove("DragonUI.prefab"); } MFUIResourceManager.GetSingleton().ReleasePreLoadResource(MFUIID.DragonUI); //AssetCacheMgr.ReleaseInstance(go); GameObject.Destroy(go); ReleaseUI(MFUIID.DragonUI); }
public override void CallWhenLoadResources() { m_instance = this; ID = MFUIManager.MFUIID.DragonUI; MFUIManager.GetSingleton().RegisterUI(ID, m_myGameObject); MFUIResourceManager.GetSingleton().PreLoadResource("DragonUIGridInfotest.prefab", ID); MFUIResourceManager.GetSingleton().PreLoadResource("fx_ui_longyujiemian_qiu.prefab", ID); MFUIResourceManager.GetSingleton().PreLoadResource("fx_ui_longyujiemian_jb.prefab", ID); MFUIGameObjectPool.GetSingleton().NotRegisterGameObjectList(MFUIManager.MFUIID.DragonUI); MFUIUtils.AttachWidget(m_myTransform, GameObject.Find("MogoMainUIPanel").transform); m_myGameObject.name = "DragonUI"; }
public void UnLoadResources() { CallWhenUnloadResources(); MFUIResourceManager.GetSingleton().ReleasePreLoadResource(ID); }