// Methods /// <summary> /// Configures <see cref="ArucoCamera.Textures"/> and calls <see cref="ArucoCamera.OnStarted"/>. /// </summary> protected virtual void WebcamController_Started(WebcamController webcamController) { var webcamTexture = WebcamController.Textures2D[cameraId]; Textures[cameraId] = new Texture2D(webcamTexture.width, webcamTexture.height, webcamTexture.format, false); base.OnStarted(); }
// Methods /// <summary> /// Configures <see cref="ArucoCamera.Textures"/> and calls <see cref="ArucoCamera.OnStarted"/>. /// </summary> protected virtual void WebcamController_Started(WebcamController webcamController) { var webcamTexture = CamFeed.Instance.GetWebCamTexture(); //HACK: Textures[cameraId] = new Texture2D(webcamTexture.width, webcamTexture.height, webcamTexture.format, false); Textures[cameraId] = new Texture2D(webcamTexture.width / 2, webcamTexture.height, TextureFormat.RGB24, false); base.OnStarted(); }
// MonoBehaviour methods /// <summary> /// Initializes <see cref="WebcamController"/> and subscribes to. /// </summary> protected override void Awake() { base.Awake(); WebcamController = gameObject.AddComponent <WebcamController>(); WebcamController.Started += WebcamController_Started; }