public void MakeDualityTarget() { if (DualityApp.ExecContext == DualityApp.ExecutionContext.Terminated) { return; } activeCamView = this; DualityApp.WindowSize = this.activeState.RenderedImageSize; DualityApp.Mouse.Source = this; DualityApp.Keyboard.Source = this; // If we have a CamView-local listener that is active, use that one. // Note: The GameViewCamViewState deactivates its own camera, since it uses the // regular Scene rendering setup, rather than providing its own. SoundListener localListener = this.CameraObj.GetComponent <SoundListener>(); if (localListener != null && localListener.Active) { localListener.MakeCurrent(); } // If we don't have a local listener, use the regular one from the current scene else { SoundListener sceneListener = Scene.Current.FindComponent <SoundListener>(); if (sceneListener != null) { sceneListener.MakeCurrent(); } } }
protected override void OnHandleDestroyed(EventArgs e) { base.OnHandleDestroyed(e); // If this was the active Camera View, stop assuming this. if (activeCamView == this) { activeCamView = null; } if (this.nativeCamObj != null) { this.nativeCamObj.Dispose(); } this.UnregisterEditorEvents(); this.SetCurrentState((CamViewState)null); }