Exemplo n.º 1
0
        private static void CheckMesh(MultiTargetAbstractBehaviour mtb)
        {
            bool      flag      = false;
            Transform transform = mtb.transform.Find("ChildTargets");

            if (transform == null)
            {
                flag = true;
            }
            else
            {
                for (int i = 0; i < transform.childCount; i++)
                {
                    Transform    expr_2B    = transform.GetChild(i);
                    MeshFilter   component  = expr_2B.GetComponent <MeshFilter>();
                    MeshRenderer component2 = expr_2B.GetComponent <MeshRenderer>();
                    if (component == null || component.sharedMesh == null || component2 == null || component2.sharedMaterials.Length == 0 || component2.sharedMaterials[0] == null)
                    {
                        flag = true;
                    }
                }
            }
            if (flag)
            {
                TrackableAccessor trackableAccessor = AccessorFactory.Create(mtb);
                if (trackableAccessor != null)
                {
                    trackableAccessor.ApplyDataSetProperties();
                }
            }
        }
Exemplo n.º 2
0
 public override void OnInspectorGUI()
 {
     base.DrawDefaultInspector();
     VuforiaUtilities.DisableGuiForPrefab(base.target);
     if (ConfigDataManager.Instance.NumConfigDataObjects > 1)
     {
         bool flag = false;
         using (this.mSerializedObject.Edit())
         {
             flag = VuforiaUtilities.DrawDatasetTrackableInspector(this.mSerializedObject, false, new Func <ConfigData, string[]>(MultiTargetEditor.GetTrackableNames), "Multi Target");
             VuforiaUtilities.DrawTrackableOptions(this.mSerializedObject, false, true, true);
         }
         if (flag)
         {
             UnityEngine.Object[] targetObjects = this.mSerializedObject.SerializedObject.targetObjects;
             for (int i = 0; i < targetObjects.Length; i++)
             {
                 TrackableAccessor trackableAccessor = AccessorFactory.Create((MultiTargetAbstractBehaviour)targetObjects[i]);
                 if (trackableAccessor != null)
                 {
                     trackableAccessor.ApplyDataSetProperties();
                 }
             }
             return;
         }
     }
     else
     {
         VuforiaUtilities.DrawMissingTargetsButton();
     }
 }
Exemplo n.º 3
0
 private void UpdateTrackableProperties(TrackableBehaviour[] trackables)
 {
     for (int i = 0; i < trackables.Length; i++)
     {
         TrackableBehaviour trackableBehaviour = trackables[i];
         if (trackableBehaviour is DataSetTrackableBehaviour)
         {
             TrackableAccessor trackableAccessor = AccessorFactory.Create((DataSetTrackableBehaviour)trackableBehaviour);
             if (trackableAccessor != null)
             {
                 trackableAccessor.ApplyDataSetProperties();
             }
         }
     }
 }