Rotator.cs 399 B

123456789101112131415161718
  1. using UnityEngine;
  2. namespace Unity.VRTemplate
  3. {
  4. /// <summary>
  5. /// Rotates this object at a user defined speed
  6. /// </summary>
  7. public class Rotator : MonoBehaviour
  8. {
  9. [SerializeField, Tooltip("Angular velocity in degrees per second")]
  10. Vector3 m_Velocity;
  11. void Update()
  12. {
  13. transform.Rotate(m_Velocity * Time.deltaTime);
  14. }
  15. }
  16. }