PointProximityField.cs 421 B

1234567891011121314151617181920
  1. using UnityEngine;
  2. using UnityEngine.Assertions;
  3. namespace Rokid.UXR.Interaction {
  4. public class PointProximityField : MonoBehaviour, IProximityField
  5. {
  6. [SerializeField]
  7. private Transform _centerPoint;
  8. protected virtual void Start()
  9. {
  10. Assert.IsNotNull(_centerPoint);
  11. }
  12. public Vector3 ComputeClosestPoint(Vector3 point)
  13. {
  14. return _centerPoint.position;
  15. }
  16. }
  17. }