Exemplo n.º 1
0
 public static void UpdateAll()
 {
     for (int index = 0; index < FastLoadRequest.mRequests.Count && FastLoadRequest.mLoadTime < 0.00833333376795053; ++index)
     {
         FastLoadRequest mRequest = FastLoadRequest.mRequests[index];
         mRequest.UpdateLoading();
         if (mRequest.isDone)
         {
             --index;
         }
     }
     FastLoadRequest.mLoadTime = 0.0;
 }
Exemplo n.º 2
0
    private void Update()
    {
        bool  flag = true;
        float unscaledDeltaTime = Time.get_unscaledDeltaTime();

        for (int index = this.mAssetBundles.Count - 1; index >= 0; --index)
        {
            this.mAssetBundles[index].NumReferencers = 0;
        }
        for (int index = this.mAssets.Count - 1; index >= 0; --index)
        {
            if (this.mAssets[index].Request_Weak == null || !this.mAssets[index].Request_Weak.IsAlive)
            {
                if (this.mAssets[index].Asset.IsStrong)
                {
                    this.mAssets[index].Asset.MakeWeak();
                }
                else if (!this.mAssets[index].Asset.IsAlive)
                {
                    this.mAssets[index].Drop();
                    this.mAssets.RemoveAt(index);
                }
            }
        }
        for (int index = this.mLoadingAssets.Count - 1; index >= 0; --index)
        {
            LoadRequest requestStrong = this.mLoadingAssets[index].Request_Strong;
            requestStrong.KeepSourceAlive();
            if (requestStrong.isDone)
            {
                Object asset = requestStrong.asset;
                AssetManager.ManagedAsset mLoadingAsset = this.mLoadingAssets[index];
                this.mAssets.Add(mLoadingAsset);
                mLoadingAsset.Asset = AssetManager.ObjectRef <Object> .CreateStrongRef(asset);

                mLoadingAsset.HasError       = Object.op_Equality(asset, (Object)null);
                mLoadingAsset.Request_Weak   = new WeakReference((object)requestStrong);
                mLoadingAsset.Request_Strong = (LoadRequest)null;
                this.mAssets.Add(this.mLoadingAssets[index]);
                this.mLoadingAssets[index].Asset = AssetManager.ObjectRef <Object> .CreateStrongRef(asset);

                this.mLoadingAssets[index].HasError = Object.op_Equality(asset, (Object)null);
                this.mLoadingAssets[index].Request  = new WeakReference((object)requestStrong);
                this.mLoadingAssets[index].Request2 = (WeakReference)null;
                this.mLoadingAssets.RemoveAt(index);
                if (Object.op_Inequality(asset, (Object)null))
                {
                    System.Type type = ((object)asset).GetType();
                    mLoadingAsset.IsIndependent = (object)type == (object)typeof(Texture2D) || type.IsSubclassOf(typeof(Texture2D));
                }
            }
        }
        FastLoadRequest.UpdateAll();
        if (this.mSceneRequests.Count > 0)
        {
            flag = false;
        }
        for (int index = 0; index < this.mSceneRequests.Count; ++index)
        {
            if (this.mSceneRequests[index].isDone)
            {
                this.mSceneRequests.RemoveAt(index--);
            }
        }
        if (!flag)
        {
            return;
        }
        this.UpdateAssetBundles(unscaledDeltaTime);
        this.UnloadUnusedAssetBundles(false, false);
    }