Aetheria/Assets/Plugins/VolumeCloud/Scripts/MouseMovement.cs

16 lines
509 B
C#
Raw Normal View History

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Yangrc.VolumeCloud.Sample {
public class MouseMovement: MonoBehaviour {
private void Update() {
float yaw = Input.GetAxis("Mouse X");
float pitch = -Input.GetAxis("Mouse Y");
var currAngle = transform.rotation.eulerAngles;
currAngle.x += pitch;
currAngle.y += yaw;
transform.rotation = Quaternion.Euler(currAngle);
}
}
}