using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CameraChange : MonoBehaviour
{
    public Camera FPSCamera;
    public Camera TPSCamera;
    public GameObject AgentOBJ;

    public void switchCamera()
    {
        if (TPSCamera.enabled && !FPSCamera.enabled)
        {
            ShowFPSView();
        }else if(FPSCamera.enabled && !TPSCamera.enabled)
        {
            ShowTPSView();
        }
        else
        {
            ShowFPSView();
        }
    }

    public void ShowTPSView()
    {
        TPSCamera.enabled = true;
        FPSCamera.enabled = false;
        AgentOBJ.GetComponent<RaySensors>().showInGameRay = true;
    }
    public void ShowFPSView()
    {
        FPSCamera.enabled = true;
        TPSCamera.enabled = false;
        AgentOBJ.GetComponent<RaySensors>().showInGameRay = false;
    }
}
