Пример #1
0
 public override void OnInspectorGUI()
 {
     base.DrawDefaultInspector();
     VuforiaUtilities.DisableGuiForPrefab(base.target);
     using (this.mSerializedObject.Edit())
     {
         int      num   = this.mSerializedObject.IsTemplateMode ? 0 : 1;
         string[] array = new string[]
         {
             "Word Template",
             "Predefined Word"
         };
         if (EditorGUILayout.Popup("Type", num, array, new GUILayoutOption[0]) == 0)
         {
             this.mSerializedObject.Mode = WordTemplateMode.Template;
         }
         else
         {
             this.mSerializedObject.Mode = WordTemplateMode.SpecificWord;
             EditorGUILayout.PropertyField(this.mSerializedObject.SpecificWordProperty, new GUIContent("Word to recognize"), new GUILayoutOption[0]);
         }
     }
     if (GUI.changed)
     {
         WordEditor.UpdateMesh((WordAbstractBehaviour)base.target);
         SceneManager.Instance.SceneUpdated();
     }
 }
 public override void OnInspectorGUI()
 {
     base.DrawDefaultInspector();
     VuforiaUtilities.DisableGuiForPrefab(base.target);
     using (base.serializedObject.Edit())
     {
         bool expr_28 = SceneManager.Instance.ExtendedTrackingEnabledOnATarget();
         if (expr_28)
         {
             EditorGUILayout.HelpBox("Smart Terrain cannot be enabled at the same time as Extended Tracking.", MessageType.Info);
         }
         bool enabled = GUI.enabled;
         GUI.enabled = !expr_28;
         EditorGUILayout.PropertyField(this.mAutomaticStart, new GUIContent("Start Automatically"), new GUILayoutOption[0]);
         GUI.enabled = enabled;
         if (((ReconstructionAbstractBehaviour)base.target).GetComponent <ReconstructionFromTargetAbstractBehaviour>() != null)
         {
             EditorGUILayout.HelpBox("Set the checkbox below to create a navigation mesh for the primary surface. A padding around props can be defined below.", MessageType.None);
             EditorGUILayout.PropertyField(this.mNavMeshUpdates, new GUIContent("Create Nav Mesh"), new GUILayoutOption[0]);
             if (this.mNavMeshUpdates.boolValue)
             {
                 EditorGUILayout.PropertyField(this.mNavMeshPadding, new GUIContent("Nav Mesh Padding"), new GUILayoutOption[0]);
             }
             EditorGUILayout.HelpBox("Define the maximum area of smart terrain with an axis-aligned rectangle around the smart terrain center", MessageType.None);
             EditorGUILayout.PropertyField(this.mMaximumExtentEnabled, new GUIContent("Define Max Primary Surface Area"), new GUILayoutOption[0]);
             if (this.mMaximumExtentEnabled.boolValue)
             {
                 this.mMaximumExtent.rectValue = EditorGUILayout.RectField("Maximum Area", this.mMaximumExtent.rectValue, new GUILayoutOption[0]);
             }
         }
     }
     GUI.enabled = true;
 }
Пример #3
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();
     }
 }
Пример #4
0
 public override void OnInspectorGUI()
 {
     base.DrawDefaultInspector();
     VuforiaUtilities.DisableGuiForPrefab(base.target);
     if (ConfigDataManager.Instance.NumConfigDataObjects > 1)
     {
         using (this.mSerializedObject.Edit())
         {
             if (VuforiaUtilities.DrawDatasetTrackableInspector(this.mSerializedObject, false, new Func <ConfigData, string[]>(VuMarkEditor.GetTrackableNames), "VuMark Template"))
             {
                 ConfigData.VuMarkData vuMarkData;
                 ConfigDataManager.Instance.GetConfigData(this.mSerializedObject.GetDataSetName()).GetVuMarkTarget(this.mSerializedObject.TrackableName, out vuMarkData);
                 VuMarkEditor.UpdateDataSetInfo(this.mSerializedObject, vuMarkData);
                 VuMarkEditor.UpdateAspectRatio(this.mSerializedObject, vuMarkData.size);
                 VuMarkEditor.UpdateScale(this.mSerializedObject, vuMarkData.size);
                 VuMarkEditor.UpdateMaterial(this.mSerializedObject);
             }
             this.mSerializedObject.WidthProperty.FixApproximatelyEqualFloatValues();
             EditorGUILayout.PropertyField(this.mSerializedObject.WidthProperty, new GUIContent("Width"), new GUILayoutOption[0]);
             this.mSerializedObject.HeightProperty.FixApproximatelyEqualFloatValues();
             EditorGUILayout.PropertyField(this.mSerializedObject.HeightProperty, new GUIContent("Height"), new GUILayoutOption[0]);
             EditorGUILayout.LabelField(new GUIContent("ID Type"), new GUIContent(this.mSerializedObject.IdType.ToString()), new GUILayoutOption[0]);
             EditorGUILayout.LabelField(new GUIContent("ID Length"), new GUIContent(this.mSerializedObject.IdLength.ToString()), new GUILayoutOption[0]);
             string text = "Define whether the VuMark has a changing background per instance,signaling to SDK how to track it. \nIf enabled, the SDK tracks this VuMark based on what is seen by the camera and not assume the template background image is useful for tracking because the background can change per instance. \nIf disabled, the SDK tracks this VuMark based on the template used to create the dataset. This is the default behavior.";
             EditorGUILayout.PropertyField(this.mSerializedObject.TrackingFromRuntimeAppearanceProperty, new GUIContent("Track From Appearance", text), new GUILayoutOption[0]);
             VuforiaUtilities.DrawTrackableOptions(this.mSerializedObject, true, true, false);
             return;
         }
     }
     VuforiaUtilities.DrawMissingTargetsButton();
 }
Пример #5
0
 public override void OnInspectorGUI()
 {
     VuforiaUtilities.DisableGuiForPrefab(base.target);
     base.DrawDefaultInspector();
     using (base.serializedObject.Edit())
     {
         bool flag = true;
         bool showCameraAnchors = true;
         bool flag2             = true;
         if (VuforiaUtilities.GetPrefabType(base.target) != PrefabType.Prefab)
         {
             flag2 = false;
             VuforiaAbstractConfiguration expr_3C = VuforiaAbstractConfigurationEditor.LoadConfigurationObject();
             VuforiaAbstractConfiguration.DigitalEyewearConfiguration digitalEyewear = expr_3C.DigitalEyewear;
             bool   arg_74_0 = digitalEyewear.EyewearType == DigitalEyewearARController.EyewearType.VideoSeeThrough && digitalEyewear.StereoFramework > DigitalEyewearARController.StereoFramework.Vuforia;
             bool   flag3    = digitalEyewear.EyewearType == DigitalEyewearARController.EyewearType.OpticalSeeThrough && digitalEyewear.SeeThroughConfiguration == DigitalEyewearARController.SeeThroughConfiguration.HoloLens;
             object expr_74  = arg_74_0;
             flag = ((arg_74_0 || flag3) != false);
             showCameraAnchors = (expr_74 != null);
             bool autoInitAndStartTracker = expr_3C.DeviceTracker.AutoInitAndStartTracker;
             int  num = 3;
             if (autoInitAndStartTracker && this.mWorldCenterMode.intValue != num)
             {
                 this.mWorldCenterMode.intValue = num;
             }
             else if (!autoInitAndStartTracker && this.mWorldCenterMode.intValue == num)
             {
                 this.mWorldCenterMode.intValue = 2;
             }
             if (flag && !this.WereBindingFieldsExposed)
             {
                 this.WereBindingFieldsExposed = true;
                 if (this.CentralAnchorPoint == null && (this.mWorldCenterMode.intValue == 1 || this.mWorldCenterMode.intValue == 0))
                 {
                     this.mWorldCenterMode.intValue = 2;
                 }
             }
             else if (!flag && this.WereBindingFieldsExposed)
             {
                 this.WereBindingFieldsExposed = false;
             }
         }
         VuforiaARController.WorldCenterMode worldCenterMode = this.DrawWorldCenterModeInspector();
         if (flag2 || worldCenterMode == VuforiaARController.WorldCenterMode.SPECIFIC_TARGET)
         {
             this.DrawWorldCenterInspector();
         }
         if (flag)
         {
             this.DrawDigitalEyewearInspector(worldCenterMode, showCameraAnchors);
         }
     }
     if (GUILayout.Button("Open Vuforia configuration", new GUILayoutOption[0]))
     {
         VuforiaAbstractConfigurationEditor.Init();
     }
 }
Пример #6
0
 public override void OnInspectorGUI()
 {
     base.DrawDefaultInspector();
     VuforiaUtilities.DisableGuiForPrefab(base.target);
     using (base.serializedObject.Edit())
     {
         EditorGUILayout.PropertyField(this.mName, new GUIContent("Name"), new GUILayoutOption[0]);
         EditorGUILayout.PropertyField(this.mSensitivity, new GUIContent("Sensitivity Setting"), new GUILayoutOption[0]);
     }
     GUI.enabled = true;
 }
 public override void OnInspectorGUI()
 {
     base.DrawDefaultInspector();
     VuforiaUtilities.DisableGuiForPrefab(base.target);
     if (Application.isPlaying)
     {
         GUI.enabled = false;
     }
     using (base.serializedObject.Edit())
     {
         EditorGUILayout.PropertyField(this.mNumDivisions, new GUIContent(BackgroundPlaneBehaviourEditor.NumDivisionsText, BackgroundPlaneBehaviourEditor.ToolTipNumDivisions), new GUILayoutOption[0]);
     }
     GUI.enabled = true;
 }
Пример #8
0
 public override void OnInspectorGUI()
 {
     base.DrawDefaultInspector();
     VuforiaUtilities.DisableGuiForPrefab(base.target);
     using (this.mSerializedObject.Edit())
     {
         EditorGUILayout.HelpBox("The mesh filter and collider selected below will be automatically updated with new mesh revisions of the primary smart terrain surface. Set them to None to ignoremesh updates.", MessageType.None);
         EditorGUILayout.PropertyField(this.mSerializedObject.MeshFilterToUpdateProperty, new GUIContent("MeshFilter to update"), new GUILayoutOption[0]);
         EditorGUILayout.PropertyField(this.mSerializedObject.MeshColliderToUpdateProperty, new GUIContent("MeshCollider to update"), new GUILayoutOption[0]);
     }
     if (GUI.changed)
     {
         SceneManager.Instance.SceneUpdated();
     }
 }
Пример #9
0
 public override void OnInspectorGUI()
 {
     base.DrawDefaultInspector();
     VuforiaUtilities.DisableGuiForPrefab(base.target);
     using (this.mSerializedObject.Edit())
     {
         EditorGUILayout.HelpBox("This is a prop template that will be duplicated at runtime for newly found smart terrain props. The DefaultSmartTerrainEventHandler will use the same template for every prop at runtime. You can implement a custom ISmartTerrainEventHandler to create a different behavior.", MessageType.Info);
         EditorGUILayout.HelpBox("The mesh filter, mesh collider and/or box collider selected below will be automatically updated with new revisions of the smart terrain prop. Set them to None to ignore updates.", MessageType.None);
         EditorGUILayout.PropertyField(this.mSerializedObject.MeshFilterToUpdateProperty, new GUIContent("MeshFilter to update"), new GUILayoutOption[0]);
         EditorGUILayout.PropertyField(this.mSerializedObject.MeshColliderToUpdateProperty, new GUIContent("MeshCollider to update"), new GUILayoutOption[0]);
         EditorGUILayout.PropertyField(this.mSerializedObject.BoxColliderToUpdateProperty, new GUIContent("BoxCollider to update"), new GUILayoutOption[0]);
     }
     if (GUI.changed)
     {
         SceneManager.Instance.SceneUpdated();
     }
 }
 public override void OnInspectorGUI()
 {
     base.DrawDefaultInspector();
     VuforiaUtilities.DisableGuiForPrefab(base.target);
     using (this.mSerializedObject.Edit())
     {
         ImageTargetType imageTargetType = this.mSerializedObject.ImageTargetType;
         string[]        array           = new string[]
         {
             "Predefined",
             "User Defined",
             "Cloud Reco"
         };
         ImageTargetType[] array2 = new ImageTargetType[]
         {
             ImageTargetType.PREDEFINED,
             ImageTargetType.USER_DEFINED,
             ImageTargetType.CLOUD_RECO
         };
         this.mSerializedObject.ImageTargetType = array2[EditorGUILayout.Popup("Type", array2.ToList <ImageTargetType>().IndexOf(this.mSerializedObject.ImageTargetType), array, new GUILayoutOption[0])];
         bool flag = this.mSerializedObject.ImageTargetType != imageTargetType;
         if (flag)
         {
             this.mSerializedObject.AutoSetOccluderFromTargetSize = false;
         }
         if (this.mSerializedObject.ImageTargetType == ImageTargetType.PREDEFINED)
         {
             this.DrawPredefinedTargetInspectorUI(flag);
         }
         else if (this.mSerializedObject.ImageTargetType == ImageTargetType.USER_DEFINED)
         {
             this.DrawUserDefinedTargetInspectorUI(flag);
         }
         else
         {
             this.DrawCloudRecoTargetInspectorUI(flag);
         }
     }
 }
 public override void OnInspectorGUI()
 {
     base.DrawDefaultInspector();
     VuforiaUtilities.DisableGuiForPrefab(base.target);
     if (ConfigDataManager.Instance.NumConfigDataObjects > 1)
     {
         using (this.mSerializedObject.Edit())
         {
             bool flag = VuforiaUtilities.DrawDatasetTrackableInspector(this.mSerializedObject, false, new Func <ConfigData, string[]>(ObjectTargetEditor.GetTrackableNames), "Object Target");
             this.mSerializedObject.LengthProperty.FixApproximatelyEqualFloatValues();
             EditorGUILayout.PropertyField(this.mSerializedObject.LengthProperty, new GUIContent("Length"), new GUILayoutOption[0]);
             this.mSerializedObject.WidthProperty.FixApproximatelyEqualFloatValues();
             EditorGUILayout.PropertyField(this.mSerializedObject.WidthProperty, new GUIContent("Width"), new GUILayoutOption[0]);
             this.mSerializedObject.HeightProperty.FixApproximatelyEqualFloatValues();
             EditorGUILayout.PropertyField(this.mSerializedObject.HeightProperty, new GUIContent("Height"), new GUILayoutOption[0]);
             EditorGUILayout.PropertyField(this.mSerializedObject.ShowBoundingBoxProperty, new GUIContent("Show Bounding Box"), new GUILayoutOption[0]);
             VuforiaUtilities.DrawTrackableOptions(this.mSerializedObject, true, true, true);
             if (flag)
             {
                 ConfigData.ObjectTargetData objectTargetData;
                 ConfigDataManager.Instance.GetConfigData(this.mSerializedObject.GetDataSetName()).GetObjectTarget(this.mSerializedObject.TrackableName, out objectTargetData);
                 ObjectTargetEditor.UpdateAspectRatio(this.mSerializedObject, objectTargetData.size);
                 ObjectTargetEditor.UpdateBoundingBox(this.mSerializedObject, objectTargetData.bboxMin, objectTargetData.bboxMax);
                 ObjectTargetEditor.UpdateScale(this.mSerializedObject, objectTargetData.size);
                 ObjectTargetEditor.UpdatePreviewImage(this.mSerializedObject, objectTargetData.targetID);
             }
             if (this.mSerializedObject.PreviewImage)
             {
                 GUILayout.Label(this.mSerializedObject.PreviewImage, new GUILayoutOption[]
                 {
                     GUILayout.Width(512f)
                 });
             }
             return;
         }
     }
     VuforiaUtilities.DrawMissingTargetsButton();
 }
 public override void OnInspectorGUI()
 {
     base.DrawDefaultInspector();
     VuforiaUtilities.DisableGuiForPrefab(base.target);
     if (ConfigDataManager.Instance.NumConfigDataObjects > 1)
     {
         using (this.mSerializedObject.Edit())
         {
             if (VuforiaUtilities.DrawDatasetTrackableInspector(this.mSerializedObject, false, new Func <ConfigData, string[]>(CylinderTargetEditor.GetTrackableNames), "Cylinder Target"))
             {
                 ConfigData.CylinderTargetData cylinderTargetData;
                 ConfigDataManager.Instance.GetConfigData(this.mSerializedObject.GetDataSetName()).GetCylinderTarget(this.mSerializedObject.TrackableName, out cylinderTargetData);
                 CylinderTargetEditor.UpdateAspectRatio(this.mSerializedObject, cylinderTargetData);
                 CylinderTargetEditor.UpdateScale(this.mSerializedObject, cylinderTargetData.sideLength);
             }
             EditorGUILayout.PropertyField(this.mSerializedObject.SideLengthProperty, new GUIContent("Side length"), new GUILayoutOption[0]);
             EditorGUILayout.PropertyField(this.mSerializedObject.TopDiameterProperty, new GUIContent("Top diameter"), new GUILayoutOption[0]);
             EditorGUILayout.PropertyField(this.mSerializedObject.BottomDiameterProperty, new GUIContent("Bottom diameter"), new GUILayoutOption[0]);
             VuforiaUtilities.DrawTrackableOptions(this.mSerializedObject, true, true, true);
             return;
         }
     }
     VuforiaUtilities.DrawMissingTargetsButton();
 }
Пример #13
0
 public override void OnInspectorGUI()
 {
     VuforiaUtilities.DisableGuiForPrefab(base.target);
     base.DrawDefaultInspector();
     using (base.serializedObject.Edit())
     {
         TextConfigData textConfigData = ConfigDataManager.Instance.GetTextConfigData();
         if (textConfigData.NumDictionaries > 1)
         {
             EditorGUILayout.HelpBox("The list of words the TextTracker can detect and track.\nThe word list is loaded from a binary file and can be extended by a list of custom words.", MessageType.Info);
             string[] array  = new string[textConfigData.NumDictionaries];
             string[] array2 = new string[textConfigData.NumDictionaries];
             textConfigData.CopyDictionaryNamesAndFiles(array, array2, 0);
             int num = VuforiaUtilities.GetIndexFromString(this.mWordListFile.stringValue, array2);
             if (num < 0)
             {
                 num = 0;
             }
             int num2 = EditorGUILayout.Popup("Word List", num, array, new GUILayoutOption[0]);
             this.mWordListFile.stringValue = array2[num2];
             if (num2 == 0)
             {
                 GUI.enabled = false;
             }
         }
         else
         {
             if (GUILayout.Button("No word list available. \nPlease copy it from the TextRecognition sample app. \nPress here to go to the download page for sample apps!", new GUILayoutOption[0]))
             {
                 SceneManager.Instance.GoToSampleAppPage();
             }
             GUI.enabled = false;
         }
         int      expr_D8 = textConfigData.NumWordLists;
         string[] array3  = new string[expr_D8];
         string[] array4  = new string[expr_D8];
         textConfigData.CopyWordListNamesAndFiles(array3, array4, 0);
         int num3 = VuforiaUtilities.GetIndexFromString(this.mCustomWordListFile.stringValue, array4);
         if (num3 < 0)
         {
             num3 = 0;
         }
         int num4 = EditorGUILayout.Popup("Additional Word File", num3, array3, new GUILayoutOption[0]);
         if (num4 != num3)
         {
             if (num4 != 0)
             {
                 TextRecoEditor.TestValidityOfWordListFile(array4[num4]);
             }
             this.mCustomWordListFile.stringValue = array4[num4];
         }
         EditorGUILayout.LabelField("Additional Words:", new GUILayoutOption[0]);
         EditorGUILayout.HelpBox("Write one word per line. Open compound words can be specified using whitespaces.", MessageType.None);
         this.mAdditionalCustomWords.stringValue = EditorGUILayout.TextArea(this.mAdditionalCustomWords.stringValue, new GUILayoutOption[0]);
         EditorGUILayout.Space();
         EditorGUILayout.Space();
         EditorGUILayout.HelpBox("The filter list allows to specify subset of words that will be detected and tracked.", MessageType.Info);
         EditorGUILayout.PropertyField(this.mFilterMode, new GUIContent("Filter Mode"), new GUILayoutOption[0]);
         if (this.mFilterMode.enumValueIndex != 0)
         {
             int num5 = VuforiaUtilities.GetIndexFromString(this.mFilterListFile.stringValue, array4);
             if (num5 < 0)
             {
                 num5 = 0;
             }
             int num6 = EditorGUILayout.Popup("Filter List File", num5, array3, new GUILayoutOption[0]);
             if (num6 != num5)
             {
                 if (num6 != 0)
                 {
                     TextRecoEditor.TestValidityOfWordListFile(array4[num6]);
                 }
                 this.mFilterListFile.stringValue = array4[num6];
             }
             EditorGUILayout.LabelField("Additional Filter Words:", new GUILayoutOption[0]);
             EditorGUILayout.HelpBox("Write one word per line. Open compound words can be specified using whitespaces.", MessageType.None);
             this.mAdditionalFilterWords.stringValue = EditorGUILayout.TextArea(this.mAdditionalFilterWords.stringValue, new GUILayoutOption[0]);
         }
         EditorGUILayout.HelpBox("It is possible to use Word Prefabs to define augmentations for detected words. Each Word Prefab can be instantiated up to a maximum number.", MessageType.Info);
         if (EditorGUILayout.Toggle("Use Word Prefabs", this.mWordPrefabCreationMode.enumValueIndex == 1, new GUILayoutOption[0]))
         {
             this.mWordPrefabCreationMode.enumValueIndex = 1;
             EditorGUILayout.PropertyField(this.mMaximumWordInstances, new GUIContent("Max Simultaneous Words"), new GUILayoutOption[0]);
         }
         else
         {
             this.mWordPrefabCreationMode.enumValueIndex = 0;
         }
     }
     GUI.enabled = true;
 }