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

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class EnvironmentRotator : MonoBehaviour
  5. {
  6. [SerializeField]
  7. private RotationController m_ship;
  8. // Update is called once per frame
  9. void Update()
  10. {
  11. if (m_ship != null)
  12. transform.RotateAround(m_ship.Position, m_ship.RotationAxis, 360/m_ship.EnvironmentRotationPeriod * Time.deltaTime);
  13. }
  14. private void Reset()
  15. {
  16. m_ship = FindObjectOfType<RotationController>();
  17. }
  18. }