Example #1
0
 //----------------------------------------------------------------------------
 public bool InitializeAferMain()
 {
     m_data = FileSystem.Instance().GetResData();
     InitUIRoot();
     Messenger.Broadcast(DgMsgID.DgMsg_RegisterAllUI);
     return(true);
 }
Example #2
0
        //----------------------------------------------------------------------------
        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);
        }
Example #3
0
        //----------------------------------------------------------------------------
        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);
        }
Example #4
0
        //----------------------------------------------------------------------------
        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]);
                }
            }
        }
Example #5
0
        //----------------------------------------------------------------------------
        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;
        }
Example #6
0
        //----------------------------------------------------------------------------
        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]);
            }
        }