Exemplo n.º 1
0
        /// <summary>
        /// 用于自定义构建
        /// </summary>
        /// <param name="infoManager"></param>
        /// <param name="loaderManager"></param>
        /// <param name="requestManager"></param>
        public void Init(IInfoManager infoManager, LoaderManager loaderManager, IRequestManager requestManager)
        {
            if (m_Inited)
            {
                return;
            }

            m_Inited = true;

            SetupSystemEvents();

            m_InfoManager    = infoManager;
            m_LoaderManager  = loaderManager;
            m_RequestManager = requestManager;
        }
Exemplo n.º 2
0
        public void Init(string allManifestFile = null, Action <bool> callback = null)
        {
            if (m_Inited)
            {
                if (m_InfoManager.inited)
                {
                    if (callback != null)
                    {
                        callback(true);
                    }
                }
                else
                {
                    m_InfoManager.onInitComplete += callback;
                }
                return;
            }
            m_Inited = true;

            //asset search path
            AssetPaths.SetupDefaultSearchPaths();

            //system events
            SetupSystemEvents();

            //crate loader manager
            m_LoaderManager = new LoaderManager(this);

            //create rquest manager
            m_RequestManager = new RequestManager(this);
            m_RequestManager.Init();

            //create info manager
            m_InfoManager = new InfoManager(this);
            m_InfoManager.Init();
            if (callback != null)
            {
                m_InfoManager.onInitComplete += callback;
            }

            if (string.IsNullOrEmpty(allManifestFile))
            {
                allManifestFile = AssetPaths.bundleManifestFile;
            }
            m_InfoManager.Load(AssetPaths.GetFullPath(allManifestFile));
        }