using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class HangManWebcam : WebCam { /// /// The display for player 1 /// public RawImage display1; /// /// The display for player 2 /// public RawImage display2; /// /// We use a different awake, since we dont want the camera to start immediatelly /// void Awake() { WebCamDevice device = WebCamTexture.devices[camdex]; tex = new WebCamTexture(device.name); display.texture = tex; } /// /// Hangman uses two different webcam_textures, we need to be able to toggle between them /// public void Switch_texture() { if(display == display1) { display = display2; } else { display = display1; } // Give the webcamTexture to the new webcam display.texture = tex; } /// /// Scene changing is implemented here to avoid problems with webcam /// public new void GotoThemeSelection() { //minigameList.GetIndexInMinigameList(MinigameIndex.HANGMAN); if (tex != null) { if (tex.isPlaying) { display.texture = null; tex.Stop(); tex = null; } } SystemController.GetInstance().BackToPreviousScene(); } }