//显示资源 private void Complate() { if (onCompleteHandler != null) { onCompleteHandler.Invoke(); } Debug.Log("资源更新完毕"); LoadBundleController.GetInstance(); SendDownOverArgs(); }
public T LoadAsset <T>(string fileName) where T : UnityEngine.Object { T r = LoadBundleController.GetInstance().LoadAsset <T>(fileName); if (null != r) { return(r); } return(LoadBundleController.GetInstance().LoadLocalAsset <T>(fileName)); }
public Sprite GetSpriteByName(int type, string assetName) { Sprite[] sprites = LoadBundleController.GetInstance().GetSpritesByName(GetAtlsPath(type), assetName); //Sprite[] sprites = GetSpritesByName(GetAtlsPath(type), assetName); for (int i = 0; i < sprites.Length; i++) { if (sprites[i].name == assetName) { return(sprites[i]); } } return(null); }
void Start() { nextSceneName = GlobalData.mScene_Main; DataManager.Instance.InitData(); TextureURLData mUrlData = PlayerInfo.Instance.mUrlData; if (mUrlData == null) { RequestUrldata(); } else { for (int i = 0; i < DataManager.Instance.mTextureKeyNameList.Count; i++) { switch (DataManager.Instance.mTextureKeyNameList[i]) { case (int)ETextureName.EHeadTex1: string url = ""; if (PlayerInfo.Instance.mPlayerData.headPortrait.Length == 1) { url = "_LocalResource/texture_head_" + PlayerInfo.Instance.mPlayerData.headPortrait; DataManager.Instance.AddTexture((int)ETextureName.EHeadTex1, Resources.Load <Texture>(url)); } else { url = PlayerInfo.Instance.mPlayerData.headPortrait; StartCoroutine(DataManager.Instance.LoadEachTexture(url, delegate(WWW www) { DataManager.Instance.AddTexture((int)ETextureName.EHeadTex1, www.texture); })); } break; case (int)ETextureName.ENotic: StartCoroutine(DataManager.Instance.LoadEachTexture(mUrlData.url, delegate(WWW www) { DataManager.Instance.AddTexture((int)ETextureName.ENotic, www.texture); })); break; case (int)ETextureName.EDatingNotic: LoadDatingTextrueOfUrl(mUrlData); break; } } } if (LoadBundleController.GetInstance().IsContainesMainBundle()) { progressFiller.value = 0; LoadBundleController.GetInstance().LoadMainBundles( () => { StartCoroutine(LoadNormalScene(nextSceneName, GlobalData.LOADNEXTSCENE_PERCENT_RATE)); SDKManager.Instance.saveSharePic(); }, (idx) => { float totalFiller = GlobalData.LOADNEXTSCENE_PERCENT_RATE * idx; progressFiller.value = totalFiller / LoadBundleController.GetInstance().TotalMainBundleCount(); }); } else { progressFiller.value = GlobalData.LOADNEXTSCENE_PERCENT_RATE; SDKManager.Instance.saveSharePic(); StartCoroutine(LoadNormalScene(nextSceneName, GlobalData.LOADNEXTSCENE_PERCENT_RATE)); } }
public TextAsset LoadLuaAB(string fileName) { TextAsset t = LoadBundleController.GetInstance().LoadLuaAB(fileName); return(t); }