Esempio n. 1
0
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.R) || Input.GetKeyDown(KeyCode.JoystickButton5))
     {
         rotateCamera(RIGHT);
     }
     if (Input.GetKeyDown(KeyCode.JoystickButton4))
     {
         rotateCamera(LEFT);
     }
     if (Input.GetKeyDown(KeyCode.V))
     {
         SwitchView();
     }
     if (followThePlayer)
     {
         camTarget = player.transform.position; //needs to be refreshed
     }
     else
     {
         _currentBiomePos = BiomeManager.WorldToBiomePos(player.transform.position);
         camTarget        = BiomeManager.BiomeToWorldPos(_currentBiomePos) + BiomeCenterOffset;
     }
     Follow(camTarget, camSize);
 }