ControlLocalizer.cs 667 B

1234567891011121314151617181920212223242526272829303132
  1. using Immersal.AR.Nreal;
  2. using Blue;
  3. using UnityEngine;
  4. using TMPro;
  5. public class ControlLocalizer: AbstractController
  6. {
  7. public NRLocalizer NRLocalizer;
  8. private float time = 0f;
  9. public bool startLocalizer=false;
  10. public int num=0;
  11. private void Awake()
  12. {
  13. this.SubscribeEvent<StartImmersalLocalizerEvent>(e =>
  14. {
  15. startLocalizer = true;
  16. }).UnSubScribeWhenGameObjectDestroyed(gameObject);
  17. }
  18. void Update()
  19. {
  20. time += Time.deltaTime;
  21. if(time > 2 && startLocalizer)
  22. {
  23. NRLocalizer.Localize();
  24. time= 0;
  25. }
  26. }
  27. }