public override void OnPreviewSettings()
        {
            WebCamTextureInspector.Init();
            GUI.enabled = !Application.isPlaying;
            WebCamTexture webCamTexture = base.target as WebCamTexture;
            bool          flag          = PreviewGUI.CycleButton((!webCamTexture.isPlaying) ? 0 : 1, WebCamTextureInspector.s_PlayIcons) != 0;

            if (flag != webCamTexture.isPlaying)
            {
                if (flag)
                {
                    webCamTexture.Stop();
                    webCamTexture.Play();
                }
                else
                {
                    webCamTexture.Pause();
                }
            }
            GUI.enabled = true;
        }
Beispiel #2
0
        public override void OnPreviewSettings()
        {
            WebCamTextureInspector.Init();
            GUI.enabled = !Application.isPlaying;
            WebCamTexture target = this.target as WebCamTexture;
            bool          flag   = PreviewGUI.CycleButton(!target.isPlaying ? 0 : 1, WebCamTextureInspector.s_PlayIcons) != 0;

            if (flag != target.isPlaying)
            {
                if (flag)
                {
                    target.Stop();
                    target.Play();
                }
                else
                {
                    target.Pause();
                }
            }
            GUI.enabled = true;
        }