using UnityEngine; namespace HPJ.Examples { /// /// An example script that rotates a object over time /// public class Rotate : MonoBehaviour { public float RotationSpeed = 5; public Space RotationSpace = Space.World; public Vector3 Rotation = new Vector3(); private Vector3 RotationVector = new Vector3(); private void Awake() { Rotation = Rotation.normalized; RotationVector = Rotation * RotationSpeed; } // Update is called once per frame void Update() { transform.Rotate(RotationVector * Time.deltaTime, RotationSpace); } } }