Пример #1
0
 /// <summary>
 /// Checks the running camera.
 /// </summary>
 void checkRunningCamera()
 {
     if (mCamera != null && mCamera.isPlaying() && mCamera.Width() > 100)
     {
         CancelInvoke("checkRunningCamera");
         this.rawimg.transform.localEulerAngles = mCamera.GetRotation();
         this.rawimg.transform.localScale       = mCamera.getVideoScale();
         RectTransform component = this.rawimg.GetComponent <RectTransform>();
         float         y         = component.sizeDelta.x * (float)this.mCamera.Height() / (float)this.mCamera.Width();
         component.sizeDelta = new Vector2(component.sizeDelta.x, y);
     }
 }
Пример #2
0
    // Update is called once per frame
    void Update()
    {
        if (webcam != null && webcam.isPlaying())
        {
            if (webcam.Width() > 200 && !isCorrected)
            {
                correctScreenRatio();
            }

            if (e_CameraPlaneObj.activeSelf)
            {
                e_CameraPlaneObj.GetComponent <Renderer>().material.mainTexture = webcam.preview;
            }
        }
    }