Beispiel #1
0
 /// <summary>
 /// Update Function, change the Camera to the next on the list.
 /// </summary>
 private void Update()
 {
     if (VRButton.onPressed(switchButton) && AllCams != null)
     {
         if (MGR_Camera.ChangeCamera(AllCams[(currIndex + 1) % AllCams.Count]))
         {
             currIndex = ++currIndex % AllCams.Count;
         }
     }
 }
Beispiel #2
0
    /// <summary>
    /// Start function, initilize each propreties and move the current canvas to the current Camera.
    /// </summary>
    private void Start()
    {
        Instance            = this;
        currentCam          = Camera.main;
        maskCameraCanvas    = GetComponentInChildren <Canvas>();
        maskPanel           = maskCameraCanvas.gameObject.GetComponentInChildren <Image>();
        currentTransparency = 0f;

        MoveCanvasTo(currentCam);
        maskPanel.color = new Color(0, 0, 0, currentTransparency);
    }