56 lines
1.0 KiB
C#
56 lines
1.0 KiB
C#
using DG.Tweening;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class Controldrivers : MonoBehaviour
|
|
{
|
|
/// <summary>
|
|
/// ³µÁ¾ÉãÏñÍ·
|
|
/// </summary>
|
|
public Transform carcameras;
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
int x = 0;
|
|
int y = 90;
|
|
public void CamerasUp()
|
|
{
|
|
if (x <= 30 && x > -30)
|
|
{
|
|
x -= 10;
|
|
carcameras.localRotation = (Quaternion.Euler(x, y, 0));
|
|
}
|
|
}
|
|
public void CamerasDown()
|
|
{
|
|
if (x < 30 && x >= -30)
|
|
{
|
|
x += 10;
|
|
carcameras.localRotation = Quaternion.Euler(x, y, 0);
|
|
}
|
|
}
|
|
public void CamerasLeft()
|
|
{
|
|
if (y <= 140 && y > 40)
|
|
{
|
|
y -= 10;
|
|
carcameras.localRotation = Quaternion.Euler(x, y, 0);
|
|
}
|
|
}
|
|
public void CamerasRight()
|
|
{
|
|
if (y < 140 && y >= 40)
|
|
{
|
|
y += 10;
|
|
carcameras.localRotation = Quaternion.Euler(x, y, 0);
|
|
}
|
|
}
|
|
}
|