71 lines
1.7 KiB
C#
71 lines
1.7 KiB
C#
using System;
|
|
using EVP;
|
|
using UnityEngine;
|
|
|
|
namespace Script.Manaegr
|
|
{
|
|
public class CarInputManager : MonoBehaviour
|
|
{
|
|
|
|
public TurnSignalController turnSignalController;
|
|
public VehicleController vehicleController;
|
|
|
|
|
|
public GameObject cam1;
|
|
public GameObject cam2;
|
|
|
|
public GameObject menuUI;
|
|
public GameObject carInfoUI;
|
|
public void Init()
|
|
{
|
|
vehicleController.maxSpeedForward = 11;
|
|
carInfoUI.SetActive(true);
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
//左转向
|
|
if (Input.GetKeyDown(KeyCode.J))
|
|
{
|
|
turnSignalController.SetSignal(1);
|
|
}
|
|
|
|
if (Input.GetKeyDown(KeyCode.K))
|
|
{
|
|
turnSignalController.SetSignal(3);
|
|
}
|
|
|
|
if (Input.GetKeyDown(KeyCode.L))
|
|
{
|
|
turnSignalController.SetSignal(2);
|
|
}
|
|
|
|
|
|
|
|
if (Input.GetKeyDown(KeyCode.U))
|
|
{
|
|
if (cam1.activeInHierarchy)
|
|
{
|
|
cam1.SetActive(false);
|
|
cam2.SetActive(true);
|
|
}
|
|
else
|
|
{
|
|
cam1.SetActive(true);
|
|
cam2.SetActive(false);
|
|
}
|
|
}
|
|
if (Input.GetKeyDown(KeyCode.Escape))
|
|
{
|
|
if (menuUI.activeInHierarchy)
|
|
{
|
|
menuUI.SetActive(false);
|
|
}
|
|
else
|
|
{
|
|
menuUI.SetActive(true);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |