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.
39 lines
871 B
C#
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;
|
|
}
|
|
}
|