コード例 #1
0
        public static SceneAssetRequest LoadSceneAsync(string path, bool additive)
        {
            if (string.IsNullOrEmpty(path))
            {
                Debug.LogError("invalid path");
                return(null);
            }

            path = GetExistPath(path);
            var asset = new SceneAssetAsyncRequest(path, additive);

            if (!additive)
            {
                if (_runningScene != null)
                {
                    _runningScene.Release();;
                    _runningScene = null;
                }
                _runningScene = asset;
            }
            asset.Load();
            asset.Retain();
            _scenes.Add(asset);
            Log(string.Format("LoadScene:{0}", path));
            return(asset);
        }
コード例 #2
0
ファイル: Assets.cs プロジェクト: hengtek/libx
        public static SceneAssetRequest LoadSceneAsync(string path, bool additive)
        {
            var asset = new SceneAssetAsyncRequest(path, additive);

            asset.Load();
            asset.Retain();
            _scenes.Add(asset);
            return(asset);
        }
コード例 #3
0
ファイル: Assets.cs プロジェクト: blinkforme/fish
        public static SceneAssetRequest LoadSceneAsync(string path, bool additive = false)
        {
            Assert.IsNotNull(path, "path != null");
            string assetBundleName;

            path = GetSearchPath(path, out assetBundleName);
            var asset = new SceneAssetAsyncRequest(path, additive)
            {
                assetBundleName = assetBundleName
            };

            Log(string.Format("LoadSceneAsync:{0}", path));
            asset.Load();
            asset.Retain();
            asset.name = path;

            LoadingScenes.Add(asset);

            if (!additive)
            {
                if (_runningScene != null)
                {
                    _runningScene.Release();
                    _runningScene = null;
                }

                _runningScene = asset;
            }
            else
            {
                if (_runningScene != null)
                {
                    _runningScene.additives.Add(asset);
                }
            }

            return(asset);
        }