Aimbot-PPO/Aimbot-PPO-MultiScene/Assets/Script/InGame/CameraChange.cs
Koha9 de066f3a65 Delete near Enemy Detect future. Use different density sensor.
Unity:
No more detect Closest enemy info. Add different density sensor let agent get more state information on the center of view. 
Adjust Start Scene UI manager. Add in game visible rayCast & information that rayCast detect.
Python:
Start use mypy black and flake8 to format Python.
2022-09-30 22:36:47 +09:00

39 lines
871 B
C#

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;
}
}