17 lines
431 B
C#
Executable File
17 lines
431 B
C#
Executable File
using UnityEngine;
|
|
using System.Collections;
|
|
|
|
public class CameraController : MonoBehaviour {
|
|
public float speedH = 0.5f;
|
|
public float speedV = 0.5f;
|
|
|
|
private float yaw = 0.0f;
|
|
private float pitch = 0.0f;
|
|
|
|
void Update() {
|
|
yaw += speedH * Input.GetAxis("Mouse X");
|
|
pitch -= speedV * Input.GetAxis("Mouse Y");
|
|
transform.eulerAngles = new Vector3(pitch, yaw, 0.0f);
|
|
}
|
|
}
|