SyncPosForGround.cs 660 B

123456789101112131415161718192021222324252627282930
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using Vuforia;
  5. public class SyncPosForGround : DefaultTrackableEventHandler
  6. {
  7. public Transform ChildPos = null;
  8. public bool isScan = false;
  9. protected override void OnTrackingFound()
  10. {
  11. if(!isScan)
  12. {
  13. MessageCenterController.Instance.Broadcast(GameEnum.MESSAGE_VUFORIA_SYNC_POS, ChildPos);
  14. isScan = true;
  15. base.OnTrackingFound();
  16. }
  17. }
  18. public void SetOpenScan()
  19. {
  20. isScan = false;
  21. }
  22. protected override void OnTrackingLost()
  23. {
  24. }
  25. }