public override void OnPreviewSettings() { MovieTextureInspector.Init(); EditorGUI.BeginDisabledGroup(Application.isPlaying || base.targets.Length > 1); MovieTexture movieTexture = this.target as MovieTexture; AudioClip audioClip = movieTexture.audioClip; bool flag = PreviewGUI.CycleButton((!movieTexture.isPlaying) ? 0 : 1, MovieTextureInspector.s_PlayIcons) != 0; if (flag != movieTexture.isPlaying) { if (flag) { movieTexture.Stop(); movieTexture.Play(); if (audioClip != null) { AudioUtil.PlayClip(audioClip); } } else { movieTexture.Pause(); if (audioClip != null) { AudioUtil.PauseClip(audioClip); } } } EditorGUI.EndDisabledGroup(); }
public override void OnPreviewSettings() { Init(); // Disallow playing movie previews in play mode. Better not to interfere // with any playback the game does. // Also disallow if more than one MovieClip selected (for now). using (new EditorGUI.DisabledScope(Application.isPlaying || targets.Length > 1)) { MovieTexture t = target as MovieTexture; AudioClip ac = t.audioClip; bool isPlaying = PreviewGUI.CycleButton(t.isPlaying ? 1 : 0, s_PlayIcons) != 0; if (isPlaying != t.isPlaying) { if (isPlaying) { t.Stop(); t.Play(); if (ac != null) { AudioUtil.PlayClip(ac); } } else { t.Pause(); if (ac != null) { AudioUtil.PauseClip(ac); } } } } }
public override void OnPreviewSettings() { MovieTextureInspector.Init(); EditorGUI.BeginDisabledGroup(Application.isPlaying || this.targets.Length > 1); MovieTexture target = this.target as MovieTexture; AudioClip audioClip = target.audioClip; bool flag = PreviewGUI.CycleButton(!target.isPlaying ? 0 : 1, MovieTextureInspector.s_PlayIcons) != 0; if (flag != target.isPlaying) { if (flag) { target.Stop(); target.Play(); if ((Object)audioClip != (Object)null) { AudioUtil.PlayClip(audioClip); } } else { target.Pause(); if ((Object)audioClip != (Object)null) { AudioUtil.PauseClip(audioClip); } } } EditorGUI.EndDisabledGroup(); }
public override void OnPreviewSettings() { Init(); using (new EditorGUI.DisabledScope(Application.isPlaying || (base.targets.Length > 1))) { MovieTexture target = base.target as MovieTexture; AudioClip audioClip = target.audioClip; bool flag = PreviewGUI.CycleButton(!target.isPlaying ? 0 : 1, s_PlayIcons) != 0; if (flag != target.isPlaying) { if (flag) { target.Stop(); target.Play(); if (audioClip != null) { AudioUtil.PlayClip(audioClip); } } else { target.Pause(); if (audioClip != null) { AudioUtil.PauseClip(audioClip); } } } } }