Assignment for RMIT Mixed Reality in 2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
576 B

  1. namespace VRTK.Examples
  2. {
  3. using UnityEngine;
  4. public class AutoRotation : MonoBehaviour
  5. {
  6. [Tooltip("Angular velocity in degrees per seconds")]
  7. public float degPerSec = 60.0f;
  8. [Tooltip("Rotation axis")]
  9. public Vector3 rotAxis = Vector3.up;
  10. // Use this for initialization
  11. private void Start()
  12. {
  13. rotAxis.Normalize();
  14. }
  15. // Update is called once per frame
  16. private void Update()
  17. {
  18. transform.Rotate(rotAxis, degPerSec * Time.deltaTime);
  19. }
  20. }
  21. }