Genesis Game Client Project Setup
This commit is contained in:
3
Assets/02_Scripts/Player/Camera/CameraMode.cs
Normal file
3
Assets/02_Scripts/Player/Camera/CameraMode.cs
Normal file
@@ -0,0 +1,3 @@
|
||||
using UnityEngine;
|
||||
|
||||
public enum CameraMode { FreeLook, Aim }
|
||||
2
Assets/02_Scripts/Player/Camera/CameraMode.cs.meta
Normal file
2
Assets/02_Scripts/Player/Camera/CameraMode.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 352c627185dd0f644a938ceeb3f50257
|
||||
25
Assets/02_Scripts/Player/Camera/PlayerCameraRig.cs
Normal file
25
Assets/02_Scripts/Player/Camera/PlayerCameraRig.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using UnityEngine;
|
||||
using Unity.Cinemachine;
|
||||
|
||||
public class PlayerCameraRig : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private CinemachineCamera _previewCam;
|
||||
[SerializeField] private CinemachineCamera _aimCam;
|
||||
|
||||
private CinemachineCamera _currentCam;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_currentCam = _previewCam;
|
||||
}
|
||||
|
||||
public float CurrentFOV
|
||||
{
|
||||
get { return _currentCam.Lens.FieldOfView; }
|
||||
set
|
||||
{
|
||||
if(_currentCam == _previewCam)
|
||||
_currentCam.Lens.FieldOfView = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/02_Scripts/Player/Camera/PlayerCameraRig.cs.meta
Normal file
2
Assets/02_Scripts/Player/Camera/PlayerCameraRig.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0c8edc71b2d7ec249bbdb4b23726bee0
|
||||
Reference in New Issue
Block a user