private void CompleteStopMrvcPlayer() { if (this.playbackEngine == null) { return; } // unsubscribe from events this.playbackEngine.PlayerStateChanged -= this.OnPlayerStateChanged; DestroyImmediate(this.playbackEngine, true); this.playbackEngine = null; this.ComponentState = ComponentState.PlayerStopped; }
private void StartMrvcPlayer(Connection connection) { if (connection == null) { return; } this.ComponentState = ComponentState.PlayerStarting; if (this.playbackEngine == null) { this.playbackEngine = this.gameObject.AddComponent <MrvcPlayer>(); if (this.playbackEngine != null) { this.playbackEngine.PlayerStateChanged += this.OnPlayerStateChanged; this.playbackEngine.SceneCamera = this.SceneCamera; this.playbackEngine.StopOnPaused = this.StopOnPaused; this.playbackEngine.Initialize(connection); } } }