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

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RotationController : MonoBehaviour
{
#region Read-Only Fields
public float RotationPeriod => m_RotationPeriod;
public Vector3 Position => transform.position;
#endregion Read-Only Fields
[SerializeField]
private float m_RotationPeriod;
private void FixedUpdate()
{
transform.Rotate(Vector3.forward, 360/m_RotationPeriod * Time.fixedDeltaTime, Space.World);
}
}