22 lines
486 B
C#
22 lines
486 B
C#
|
using System;
|
|||
|
using SHADE;
|
|||
|
|
|||
|
namespace SHADE_Scripting
|
|||
|
{
|
|||
|
public class CameraControl :Script
|
|||
|
{
|
|||
|
public float turnSpeed = 0.5f;
|
|||
|
|
|||
|
protected override void update()
|
|||
|
{
|
|||
|
//Camera
|
|||
|
Camera cam = GetComponent<Camera>();
|
|||
|
Vector2 mouseVel = Input.GetMouseVelocity();
|
|||
|
|
|||
|
cam.Pitch -= mouseVel.y * turnSpeed * (float)Time.DeltaTime;
|
|||
|
cam.Yaw += mouseVel.x * turnSpeed * (float)Time.DeltaTime;
|
|||
|
|
|||
|
}
|
|||
|
}
|
|||
|
}
|