Ejemplo n.º 1
0
        //void Awake()
        //{
        //    Init();
        //}

        public void Init(Action <bool> callback = null)
        {
            Application.lowMemory += OnLowMemory;

            //add search paths
            AssetPaths.AddSearchPath(AssetPaths.Combine(Application.persistentDataPath, AssetPaths.bundlesPath));
#if UNITY_EDITOR
            //bunlde out path
            AssetPaths.AddSearchPath(
                AssetPaths.Combine(
                    System.IO.Path.GetFullPath("."),
                    AssetPaths.bundleOutPaths,
                    UnityEditor.EditorUserBuildSettings.activeBuildTarget.ToString()
                    )
                );
#endif

            m_LoaderManager  = new LoaderManager(this);
            m_RequestManager = new RequestManager(this);

            m_InfoManager = new InfoManager(this);
            if (callback != null)
            {
                m_InfoManager.onInitComplete += callback;
            }

            m_InfoManager.Load(AssetPaths.GetFullPath(AssetPaths.bundleManifestFile));
        }
        void LoadBundle()
        {
            string assetPath = AssetPaths.GetFullPath(info.fullName);

#if ASSETMANAGER_LOG
            Debug.Log("LoadBundle " + assetPath + "," + Time.frameCount);
#endif
            LoadFromFileSync(assetPath);
            Complete();
        }
Ejemplo n.º 3
0
        void LoadBundle()
        {
            string assetPath = AssetPaths.GetFullPath(info.fullName);

#if ASSETMANAGER_LOG
            Debug.Log("LoadBundle " + assetPath + "," + Time.frameCount);
#endif
            if (assetPath.Contains("://"))
            {
                LoadFromPackage(assetPath);
            }
            else
            {
                LoadFromFile(assetPath);
            }
        }