TestTracking.cs 479 B

123456789101112131415161718192021222324
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using TMPro;
  4. using UnityEngine;
  5. public class TestTracking : MonoBehaviour
  6. {
  7. public TMP_Text text;
  8. public Transform obj;
  9. private void Start()
  10. {
  11. text.text = obj.position.ToString();
  12. }
  13. public void OnEnter( Transform TagObj)
  14. {
  15. text.text = TagObj.position.ToString();
  16. }
  17. public void OnExit(Transform TagObj)
  18. {
  19. text.text = TagObj.position.ToString();
  20. }
  21. }