Exemplo n.º 1
0
        internal override bool Update()
        {
            if (!base.Update())
            {
                return(false);
            }

            if (loadState == LoadState.Init)
            {
                return(true);
            }

            if (request == null)
            {
                loadState = LoadState.Loaded;
                error     = "request == null";
                return(false);
            }

            if (request.isDone)
            {
                if (request.assetBundle == null)
                {
                    error = "assetBundle == null";
                }
                else
                {
                    var manifest = request.assetBundle.LoadAsset <Manifest>(assetName);
                    if (manifest == null)
                    {
                        error = "manifest == null";
                    }
                    else
                    {
                        Assets.OnLoadManifest(manifest);
                    }
                }

                loadState = LoadState.Loaded;
                return(false);
            }

            return(true);
        }
Exemplo n.º 2
0
        private void Request_completed(AssetRequest ar)
        {
            _request.completed = null;
            if (_request.assetBundle == null)
            {
                base.error = "assetBundle == null";
            }
            else
            {
                var manifest = _request.assetBundle.LoadAsset <Manifest>(_assetName);
                if (manifest == null)
                {
                    base.error = "manifest == null";
                }
                else
                {
                    Assets.OnLoadManifest(manifest);
                }
            }

            loadState = LoadState.Loaded;
        }