Beispiel #1
0
    //Camera change Logic
    private void CameraPositionChange(int camPosition)
    {
        if (camPosition > 1)
        {
            camPosition = 0;
        }

        //Set camera position database
        PlayerPrefs.SetInt("CameraPosition", camPosition);

        switch (camPosition)
        {
        //Set camera position 1 which is regular camera
        case 0:
            cameraOne.SetActive(true);
            _mapActive = false;
            //Notify ThirdPersonPlayer on map status so player can move
            OnMapSwitch?.Invoke(_mapActive);
            //Time.timeScale = 1f;
            cameraTwo.SetActive(false);
            break;

        //Set camera position 2 which is map camera
        case 1:
            cameraTwo.SetActive(true);
            _mapActive = true;
            //Notify ThirdPersonPlayer on map status so player does not move
            OnMapSwitch?.Invoke(_mapActive);
            //Time.timeScale = 0f;
            cameraOne.SetActive(false);
            break;
        }
    }
Beispiel #2
0
 private void Start()
 {
     //Camera Position Set
     cameraOne.SetActive(true);
     cameraTwo.SetActive(false);
     _mapActive = false;
     //Notify ThirdPersonPlayer on map status
     OnMapSwitch?.Invoke(_mapActive);
 }