Example #1
0
 public AssetDatabaseLoader()
 {
     AssetBundleName        = String.Empty;
     OnLoadSelfBundleAction = null;
     OnLoadAllBundleAction  = null;
     LoadMethod             = enResourceLoadMethod.LoadFromFile;
     LoadState  = enLoadState.None;
     LoadMode   = enResourceLoadMode.Sync;
     BundleInfo = null;
 }
Example #2
0
 public void Reset()
 {
     AssetBundleName        = String.Empty;
     OnLoadAllBundleAction  = null;
     OnLoadSelfBundleAction = null;
     LoadMode   = enResourceLoadMode.Sync;
     LoadCache  = enResourceLoadCache.NormalLoad;
     LoadMethod = enResourceLoadMethod.LoadFromFile;
     BundleInfo = null;
     UserData   = null;
 }
Example #3
0
        public void LoadAssetSync()
        {
            var assetPath = AssetDatabase.GetAssetPathsFromAssetBundle(AssetBundleName);

            if (assetPath.Length != 0)
            {
                BundleInfo = CreateAssetDatabaseInfo(AssetBundleName, assetPath);
                BundleInfo.UpdateLastUsedTime();
            }
            LoadState = enLoadState.SelfComplete;
            OnLoadSelfBundleAction?.Invoke(this);
            LoadState          = enLoadState.AllComplete;
            BundleInfo.IsReady = true;
            OnLoadAllBundleAction?.Invoke(BundleInfo, UserData);
            OnLoadAllBundleAction = null;
            ReferencePool.Release <AssetDatabaseLoader>(this);
        }