[SerializeField]
private Camera mainCamera, thirdPersonCamera;
bool firstPersonViewOrThirdPersonView = false;
//false为主相机深度更大 , true为第三人称相机深度更大
void Update()
{
if (Input.GetKeyDown(KeyCode.V))
{
if (firstPersonViewOrThirdPersonView == false)
firstPersonViewOrThirdPersonView = true;
else
firstPersonViewOrThirdPersonView = false;
}
if (firstPersonViewOrThirdPersonView == true)
{
thirdPersonCamera.depth = 1;
mainCamera.depth = 0;
}
if (firstPersonViewOrThirdPersonView == false)
{
mainCamera.depth = 1;
thirdPersonCamera.depth = 0;
}
private Camera mainCamera, thirdPersonCamera;
bool firstPersonViewOrThirdPersonView = false;
//false为主相机深度更大 , true为第三人称相机深度更大
void Update()
{
if (Input.GetKeyDown(KeyCode.V))
{
if (firstPersonViewOrThirdPersonView == false)
firstPersonViewOrThirdPersonView = true;
else
firstPersonViewOrThirdPersonView = false;
}
if (firstPersonViewOrThirdPersonView == true)
{
thirdPersonCamera.depth = 1;
mainCamera.depth = 0;
}
if (firstPersonViewOrThirdPersonView == false)
{
mainCamera.depth = 1;
thirdPersonCamera.depth = 0;
}
}
if (Inp