Пример #1
0
 internal static void Validate()
 {
     ImageTargetAbstractBehaviour[] array = UnityEngine.Object.FindObjectsOfType <ImageTargetAbstractBehaviour>();
     for (int i = 0; i < array.Length; i++)
     {
         VirtualButtonEditor.DetectDuplicates(array[i]);
     }
     VirtualButtonAbstractBehaviour[] array2 = UnityEngine.Object.FindObjectsOfType <VirtualButtonAbstractBehaviour>();
     for (int i = 0; i < array2.Length; i++)
     {
         VirtualButtonAbstractBehaviour virtualButtonAbstractBehaviour = array2[i];
         ImageTargetAbstractBehaviour   imageTargetBehaviour           = virtualButtonAbstractBehaviour.GetImageTargetBehaviour();
         if (imageTargetBehaviour == null)
         {
             Debug.LogError("Virtual Button '" + virtualButtonAbstractBehaviour.name + "' doesn't have an Image Target as an ancestor.");
         }
         else if (imageTargetBehaviour.ImageTargetType == ImageTargetType.USER_DEFINED)
         {
             Debug.LogError("Virtual Button '" + virtualButtonAbstractBehaviour.name + "' cannot be added to a user defined target.");
         }
     }
 }
Пример #2
0
 private void AssociateVirtualButtonBehaviours(VirtualButtonAbstractBehaviour[] vbBehaviours, DataSet dataSet)
 {
     for (int i = 0; i < vbBehaviours.Length; i++)
     {
         VirtualButtonAbstractBehaviour virtualButtonBehaviour = vbBehaviours[i];
         if (virtualButtonBehaviour.VirtualButtonName == null)
         {
             Debug.LogError("VirtualButton at " + i + " has no name.");
         }
         else
         {
             ImageTargetAbstractBehaviour imageTargetBehaviour = virtualButtonBehaviour.GetImageTargetBehaviour();
             if (imageTargetBehaviour == null)
             {
                 Debug.LogError("VirtualButton named " + virtualButtonBehaviour.VirtualButtonName + " is not attached to an ImageTarget.");
             }
             else if (dataSet.Contains(imageTargetBehaviour.Trackable))
             {
                 ((IEditorImageTargetBehaviour)imageTargetBehaviour).AssociateExistingVirtualButtonBehaviour(virtualButtonBehaviour);
             }
         }
     }
 }