mirror of
https://github.com/nothke/quality-control.git
synced 2025-08-31 07:43:42 +00:00
Assembling Main scene.
This commit is contained in:
17
Assets/Scripts/ConstantRotation.cs
Normal file
17
Assets/Scripts/ConstantRotation.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class ConstantRotation: MonoBehaviour
|
||||
{
|
||||
public Vector3 Axis = Vector3.up;
|
||||
|
||||
public float RotationRate = 1f;
|
||||
|
||||
public void Update()
|
||||
{
|
||||
var rotation = transform.rotation;
|
||||
|
||||
var delta = Quaternion.AngleAxis(RotationRate * Time.deltaTime, Axis);
|
||||
|
||||
transform.SetPositionAndRotation(transform.position, rotation * delta);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user