public void Start(SPSceneManager manager, ISceneLoadOptions options, ISceneBehaviour lastScene) { _manager = manager; _options = options; _lastScene = lastScene; _routine = manager.StartRadicalCoroutine(this.DoLoad()); //GameLoopEntry.Hook.StartRadicalCoroutine(this.DoLoad(), RadicalCoroutineDisableMode.Default); }
protected override void OnDestroy() { if (object.ReferenceEquals(_activeInstance, this)) { _activeInstance = null; } base.OnDestroy(); }
private System.Collections.IEnumerator ForceUnloadRoutine(IRadicalYieldInstruction instruction, ISceneBehaviour waitingOn) { yield return(instruction); if (_lastSceneBehaviour == waitingOn) { _lastSceneBehaviour = null; } }
public IRadicalYieldInstruction Unload() { IRadicalYieldInstruction arg = null; if (_loadingOp != null) { var op = _loadingOp; _loadingOp = null; op.Cancel(); if (_currentSceneBehaviour != null) { if (op.LastScene == _currentSceneBehaviour) { _currentSceneBehaviour = null; } else { arg = _currentSceneBehaviour.EndScene(); if (arg != null) { _lastSceneBehaviour = _currentSceneBehaviour; arg = this.StartRadicalCoroutine(this.ForceUnloadRoutine(arg, _lastSceneBehaviour)); } } } } else if (_currentSceneBehaviour != null) { _currentSceneBehaviour.EndScene(); if (_currentSceneBehaviour.gameObject != null) { ObjUtil.SmartDestroy(_currentSceneBehaviour.gameObject); } } _currentSceneBehaviour = null; return(arg); }
public IProgressingYieldInstruction LoadScene(ISceneLoadOptions options) { if (options == null) { throw new System.ArgumentNullException("options"); } if (_loadingOp != null) { _loadingOp.Cancel(); if (!_loadingOp.NextSceneStarted) { _currentSceneBehaviour = null; } _loadingOp = null; } _lastSceneBehaviour = _currentSceneBehaviour; _currentSceneBehaviour = null; _loadingOp = new WaitForSceneLoaded(); _loadingOp.Start(this, options, _lastSceneBehaviour); return(_loadingOp); }
public IRadicalYieldInstruction Unload() { IRadicalYieldInstruction arg = null; if (_loadingOp != null) { var op = _loadingOp; _loadingOp = null; op.Cancel(); if(_currentSceneBehaviour != null) { if(op.LastScene == _currentSceneBehaviour) { _currentSceneBehaviour = null; } else { arg = _currentSceneBehaviour.EndScene(); if(arg != null) { _lastSceneBehaviour = _currentSceneBehaviour; arg = this.StartRadicalCoroutine(this.ForceUnloadRoutine(arg, _lastSceneBehaviour)); } } } } else if (_currentSceneBehaviour != null) { _currentSceneBehaviour.EndScene(); if (_currentSceneBehaviour.gameObject != null) ObjUtil.SmartDestroy(_currentSceneBehaviour.gameObject); } _currentSceneBehaviour = null; return arg; }
public IProgressingYieldInstruction LoadScene(ISceneLoadOptions options) { if (options == null) throw new System.ArgumentNullException("options"); if (_loadingOp != null) { _loadingOp.Cancel(); if (!_loadingOp.NextSceneStarted) _currentSceneBehaviour = null; _loadingOp = null; } _lastSceneBehaviour = _currentSceneBehaviour; _currentSceneBehaviour = null; _loadingOp = new WaitForSceneLoaded(); _loadingOp.Start(this, options, _lastSceneBehaviour); return _loadingOp; }
public void Start(SceneManager manager, ISceneLoadOptions options, ISceneBehaviour lastScene) { _manager = manager; _options = options; _lastScene = lastScene; _routine = manager.StartRadicalCoroutine(this.DoLoad()); //GameLoopEntry.Hook.StartRadicalCoroutine(this.DoLoad(), RadicalCoroutineDisableMode.Default); }
protected override void Awake() { base.Awake(); _activeInstance = this; }
protected override void OnDestroy() { if (object.ReferenceEquals(_activeInstance, this)) _activeInstance = null; base.OnDestroy(); }
protected virtual void OnSceneStarted(SceneManager manager, ISceneBehaviour sceneBehaviour) { if (this.SceneStarted != null) this.SceneStarted(sceneBehaviour); }
protected virtual void OnBeforeSceneLoaded(SceneManager manager, ISceneBehaviour sceneBehaviour) { if (this.BeforeSceneCreated != null) this.BeforeSceneCreated(sceneBehaviour); }
void ISceneBehaviourLoadOptions.OnSceneStarted(SceneManager manager, ISceneBehaviour sceneBehaviour) { this.OnSceneStarted(manager, sceneBehaviour); }
void ISceneBehaviourLoadOptions.OnBeforeSceneLoaded(SceneManager manager, ISceneBehaviour sceneBehaviour) { this.OnBeforeSceneLoaded(manager, sceneBehaviour); }
private System.Collections.IEnumerator ForceUnloadRoutine(IRadicalYieldInstruction instruction, ISceneBehaviour waitingOn) { yield return instruction; if (_lastSceneBehaviour == waitingOn) _lastSceneBehaviour = null; }
public SceneLoadingEventArgs(SceneManager manager, ISceneBehaviour scene, ISceneBehaviourLoadOptions loadOptions) { _manager = manager; _scene = scene; _options = loadOptions; }