public static PresentBoxItemIconCacheBuffer Instance() { if (PresentBoxItemIconCacheBuffer.instance == null) { PresentBoxItemIconCacheBuffer.instance = new PresentBoxItemIconCacheBuffer(300); } return(PresentBoxItemIconCacheBuffer.instance); }
public static void ReloadMaster() { DirectoryInfo directoryInfo = new DirectoryInfo(Application.persistentDataPath); foreach (FileInfo fileInfo in directoryInfo.GetFiles()) { string name = fileInfo.Name; if (name.StartsWith("MA_")) { File.Delete(Application.persistentDataPath + "/" + name); } } MasterDataMng.Instance().ClearCache(); MissionBannerCacheBuffer.ClearCacheBuffer(); MonsterIconCacheBuffer.ClearCacheBuffer(); PresentBoxItemIconCacheBuffer.ClearCacheBuffer(); TitleIconCacheBuffer.ClearCacheBuffer(); StringMaster.Reload(); AlertMaster.Reload(); }
public static void LoadTextureAsync(UITexture uiTex, string texname, Action callback = null) { if (AssetDataMng.Instance().IsAssetBundleData(texname)) { PresentBoxItemIconCacheBuffer.Instance().LoadAndCacheObj(texname, delegate(UnityEngine.Object obj) { Texture2D mainTexture = obj as Texture2D; uiTex.mainTexture = mainTexture; if (callback != null) { callback(); } }); } else { AssetDataMng.Instance().LoadObjectASync(texname, delegate(UnityEngine.Object obj) { Texture2D mainTexture = obj as Texture2D; uiTex.mainTexture = mainTexture; Hashtable hashtable = new Hashtable(); hashtable.Add("x", 1f); hashtable.Add("y", 1f); hashtable.Add("time", 0.4f); hashtable.Add("delay", 0.01f); hashtable.Add("easetype", "spring"); hashtable.Add("oncomplete", "ScaleEnd"); hashtable.Add("oncompleteparams", 0); iTween.ScaleTo(uiTex.gameObject, hashtable); if (callback != null) { callback(); } }); } }
public static void ClearCacheBuffer() { PresentBoxItemIconCacheBuffer.instance = null; }