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
506 B

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class RotationController : MonoBehaviour
  5. {
  6. #region Read-Only Fields
  7. public float RotationPeriod => m_RotationPeriod;
  8. public Vector3 Position => transform.position;
  9. #endregion Read-Only Fields
  10. [SerializeField]
  11. private float m_RotationPeriod;
  12. private void FixedUpdate()
  13. {
  14. transform.Rotate(Vector3.forward, 360/m_RotationPeriod * Time.fixedDeltaTime, Space.World);
  15. }
  16. }