//---------------------------------------------------------------------------- public bool InitializeAferMain() { m_data = FileSystem.Instance().GetResData(); InitUIRoot(); Messenger.Broadcast(DgMsgID.DgMsg_RegisterAllUI); return(true); }
//---------------------------------------------------------------------------- public bool IsPreLoadView() { ResourceListData data = FileSystem.Instance().GetResData(); if (data == null) { return(false); } sAssetInfo info = sAssetInfo.zero; data.GetAssetBundleInfo(strAssetID, ref info); return(info.bPreLoad); }
//---------------------------------------------------------------------------- public bool InitFileSystem(string strPath = null) { m_bundleDependenciseDict = new Dictionary <string, List <string> >(); m_assetBundleDict = new Dictionary <string, AssetBundle>(); m_ResourceList = new ResourceListData(); m_ResourceList.Initialize(); m_dicLoad = new Dictionary <string, CLoadData>(); m_queueNeedLoad = new Queue <sNeedLoadData>(); m_ConfigData = new ConfigData(); m_audioAssetList = new List <string>(); InitAllAssetManifest(); if (Application.isPlaying) { m_ConfigData = LauncherManager.Instance.GetConfigData(); } else { m_ConfigData = new ConfigData(); m_ConfigData.m_strDataDir = strPath; } CheckPlatform(); UnityEngine.Object objTemp = Resources.Load("config"); if (ReferenceEquals(objTemp, null)) { return(false); } var strData = objTemp.ToString(); Resources.UnloadAsset(objTemp); if (RuntimePlatform.IPhonePlayer == Application.platform) { InitPhone(); } else if (RuntimePlatform.Android == Application.platform) { InitAndroid(); } else if (RuntimePlatform.WindowsPlayer == Application.platform || RuntimePlatform.WebGLPlayer == Application.platform) { InitWeb(); } else { InitGameData(); } return(true); }
//---------------------------------------------------------------------------- private void AddUseAtlas() { m_bHasAddAtlas = true; ResourceListData data = FileSystem.Instance().GetResData(); sAssetInfo info = sAssetInfo.zero; data.GetAssetBundleInfo(strAssetID, ref info); if (info.childListAssetID != null && info.childListAssetID.Count > 0) { int nTotalCount = info.childListAssetID.Count; for (int i = 0; i < nTotalCount; i++) { m_uiSystem.AddUseAtlas(info.childListAssetID[i]); } } }
//---------------------------------------------------------------------------- public virtual void StageLoadViewer() { m_uiSystem.AddPreLoadAsset(strAssetID); ResourceListData data = FileSystem.Instance().GetResData(); sAssetInfo info = sAssetInfo.zero; data.GetAssetBundleInfo(strAssetID, ref info); if (info.childListAssetID != null && info.childListAssetID.Count > 0) { int nTotalCount = info.childListAssetID.Count; for (int i = 0; i < nTotalCount; i++) { m_uiSystem.AddPreLoadAsset(info.childListAssetID[i]); m_uiSystem.AddUseAtlas(info.childListAssetID[i]); } } m_bHasAddAtlas = true; }
//---------------------------------------------------------------------------- public void UnloadAudioAsset() { List <string> unloadList = new List <string>(); ResourceListData data = FileSystem.Instance().GetResData(); var it = m_dictAsset.GetEnumerator(); while (it.MoveNext()) { if (it.Current.Value.typeAsset == EAssetType.eAudio) { unloadList.Add(it.Current.Key); } } it.Dispose(); for (int i = 0; i < unloadList.Count; i++) { UnLoadAsset(unloadList[i]); } }