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;
|
|
|
|
[SerializeField]
|
|
private Vector3 m_RotationAxis = Vector3.forward;
|
|
|
|
|
|
|
|
public Vector3 getDownDirection(Vector3 objectPosition)
|
|
{
|
|
return Vector3.ProjectOnPlane((objectPosition - transform.position).normalized, m_RotationAxis);
|
|
}
|
|
|
|
|
|
}
|