예제 #1
0
 public AsyncOperation LoadAsync(SceneLoadParameters parameters)
 {
     ServiceLocator.Resolve <IAnalyticsService>().StatSceneLoaded(parameters.SceneName);
     _lastContext      = null;
     _captureReturnKey = parameters.CaptureReturnKey;
     if (parameters.FlushSceneStack)
     {
         _sceneStack.Clear();
     }
     if (parameters.AddToSceneStack)
     {
         _sceneStack.Push(SceneManager.GetActiveScene().name);
     }
     _lastContext = parameters.Context;
     return(SceneManager.LoadSceneAsync(FixSceneName(parameters.SceneName)));
 }
예제 #2
0
 public ComplitionPromise <object> Load(SceneLoadParameters parameters)
 {
     ServiceLocator.Resolve <IAnalyticsService>().StatSceneLoaded(parameters.SceneName);
     _lastContext = null;
     if (_lastLoadDeferred != null)
     {
         ComplitionDeferred <object> lastLoadDeferred = _lastLoadDeferred;
         _lastLoadDeferred = null;
         lastLoadDeferred.Resolve(parameters.Context);
     }
     _captureReturnKey = parameters.CaptureReturnKey;
     _lastLoadDeferred = new ComplitionDeferred <object>();
     if (parameters.FlushSceneStack)
     {
         _sceneStack.Clear();
     }
     if (parameters.AddToSceneStack)
     {
         _sceneStack.Push(SceneManager.GetActiveScene().name);
     }
     _lastContext = parameters.Context;
     SceneManager.LoadScene(FixSceneName(parameters.SceneName));
     return(_lastLoadDeferred.Promise());
 }