AxisController.cs 560 B

1234567891011121314151617181920212223242526
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. namespace Rokid.MRC
  6. {
  7. public class AxisController : MonoBehaviour
  8. {
  9. private Transform axisTrans;
  10. public Text txtDesc;
  11. void Start()
  12. {
  13. axisTrans = transform.parent;
  14. }
  15. void Update()
  16. {
  17. txtDesc.text = $"Pos : {axisTrans.position} \n Rot : {axisTrans.rotation}";
  18. transform.rotation = Quaternion.LookRotation(Camera.main.transform.forward);
  19. }
  20. }
  21. }