コード例 #1
0
        /// <summary>
        /// 初始化Window需要的数据
        /// </summary>
        /// <returns></returns>
        private bool InitLoader()
        {
            if (!EditorApplication.isPlaying)
            {
                return(false);
            }
            if (m_BundleLoader != null)
            {
                return(true);
            }
            //获取AssetManager
            bool isInitSuccess = (bool)DotAssetManager.GetInstance().AsDynamic().m_IsInit;

            if (!isInitSuccess)
            {
                return(false);
            }

            DotAssetManager assetManager = DotAssetManager.GetInstance();
            dynamic         loader       = (AssetBundleLoader)assetManager.AsDynamic().m_AssetLoader;

            if (!(loader is AssetBundleLoader))
            {
                return(false);
            }
            m_BundleLoader = loader;
            dynamic loaderDynamic = m_BundleLoader.AsDynamic();

            m_AssetAddressConfig  = loaderDynamic.m_AssetAddressConfig;
            m_AssetBundleManifest = loaderDynamic.m_AssetBundleManifest;
            m_AssetNodeDic        = loaderDynamic.m_AssetNodeDic;
            m_BundleNodeDic       = loaderDynamic.m_BundleNodeDic;
            return(true);
        }