Beispiel #1
0
        /// <summary>
        /// Instantiates a GameObject with a MLUTrackedPCF component that tracks the given PCF status. PCF event listeners can be specified in the parameters.
        /// </summary>
        public static MLUTrackedPCF CreateTrackedPCF(MLPCF PCF, Action <MLUTrackedPCF> onUpdate = null, Action <MLUTrackedPCF> onLost = null, Action <MLUTrackedPCF> onRegain = null)
        {
            MLUTrackedPCF trackedPCF = (new GameObject()).AddComponent <MLUTrackedPCF>();

            if (onUpdate != null)
            {
                trackedPCF.OnUpdate += onUpdate;
            }
            if (onLost != null)
            {
                trackedPCF.OnLost += onLost;
            }
            if (onRegain != null)
            {
                trackedPCF.OnRegain += onRegain;
            }
            trackedPCF.PCF = PCF;

            if (trackedPCF.inactiveOnLost && PCF.CurrentResult != MLResultCode.Ok)
            {
                trackedPCF.gameObject.SetActive(false);
            }

            return(trackedPCF);
        }
Beispiel #2
0
 private void OnTrackedPCFCreateHandler(MLUTrackedPCF trackedPCF)
 {
     // if the object is binded we try to reaply the binding (since new tracked PCF may be binded and better than previous ones)
     if (IsBinded)
     {
         BindingInfo bindingInfo = CurrentBindingInfo ?? default(BindingInfo);
         TryApplyBinding(bindingInfo.landscapeBinding);
     }
 }
        private static void OnPCFFoundHandler(MLPCF PCF)
        {
            if (PCFs.Contains(PCF))
            {
                return;
            }

            MLPersistentCoordinateFrames.QueueForUpdates(PCF);             // this doesn't work as spected for now
            MLUTrackedPCF trackedPCF = MLUTrackedPCF.CreateTrackedPCF(PCF);

            trackedPCF.InactiveOnLost = disableTrackedPCFsOnLost;
            PCFs.Add(PCF);
            trackedPCFs.Add(trackedPCF);
            if (OnTrackedPCFCreate != null)
            {
                OnTrackedPCFCreate(trackedPCF);
            }

            Debug.Log("MLULandscape: started tracking PCF [CFUID: " + PCF.CFUID + " | result: " + PCF.CurrentResult + "]");
        }
 public BindingInfo(MLULandscapeBinding landscapeBinding, MLUPCFBinding binding, MLUTrackedPCF trackedPCF)
 {
     this.landscapeBinding = landscapeBinding;
     this.binding          = binding;
     this.trackedPCF       = trackedPCF;
 }