예제 #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 SceneAssetRequest(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
 public static void UnloadScene(SceneAssetRequest scene)
 {
     scene.Release();
 }