ControlLocalizer.cs 745 B

1234567891011121314151617181920212223242526272829303132
  1. using Immersal.AR.Nreal;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class ControlLocalizer: MonoBehaviour
  5. {
  6. public NRLocalizer NRLocalizer;
  7. public GameObject irobot;
  8. public List<GameObject> list = new List<GameObject>();
  9. private float time = 0f;
  10. private bool first=false;
  11. void Update()
  12. {
  13. time += Time.deltaTime;
  14. if(time > 2 && (irobot.activeSelf || first))
  15. {
  16. NRLocalizer.Localize();
  17. time= 0;
  18. if (!first)
  19. {
  20. first = true;
  21. foreach(GameObject go in list)
  22. {
  23. go.SetActive(true);
  24. }
  25. }
  26. }
  27. }
  28. }