示例#1
0
        // 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();
        }
示例#2
0
        // 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();
        }
示例#3
0
        // 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;
        }