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(); } }
private static void SetLicenseKeyInGlobalConfiguration(string licenseKey) { VuforiaAbstractConfiguration expr_05 = VuforiaAbstractConfigurationEditor.LoadConfigurationObject(); Undo.RecordObject(expr_05, "Setting License Key"); expr_05.Vuforia.LicenseKey = licenseKey; EditorUtility.SetDirty(expr_05); AssetDatabase.SaveAssets(); }
public bool SmartTerrainInitializationEnabled() { if (VuforiaAbstractConfigurationEditor.LoadConfigurationObject().SmartTerrainTracker.AutoInitAndStartTracker) { return(true); } DataSetTrackableBehaviour[] array = UnityEngine.Object.FindObjectsOfType <DataSetTrackableBehaviour>(); for (int i = 0; i < array.Length; i++) { IEditDataSetBehaviour editDataSetBehaviour = array[i]; if (editDataSetBehaviour.InitializeSmartTerrain && editDataSetBehaviour.ReconstructionToInitialize != null) { return(true); } } return(false); }
internal static bool OnConfigDataChanged() { string[] dataSetList = new string[ConfigDataManager.Instance.NumConfigDataObjects - 1]; ConfigDataManager.Instance.GetConfigDataNames(dataSetList, false); VuforiaAbstractConfiguration vuforiaAbstractConfiguration = VuforiaAbstractConfigurationEditor.LoadConfigurationObject(); if (vuforiaAbstractConfiguration == null) { return(false); } VuforiaAbstractConfiguration.DatabaseLoadConfiguration expr_45 = vuforiaAbstractConfiguration.DatabaseLoad; List <string> list = expr_45.DataSetsToActivate.ToList <string>(); list.RemoveAll((string s) => Array.Find <string>(dataSetList, (string str) => str.Equals(s)) == null); expr_45.DataSetsToActivate = list.ToArray(); list = expr_45.DataSetsToLoad.ToList <string>(); list.RemoveAll((string s) => Array.Find <string>(dataSetList, (string str) => str.Equals(s)) == null); expr_45.DataSetsToLoad = list.ToArray(); return(true); }
private VuforiaARController.WorldCenterMode DrawWorldCenterModeInspector() { int intValue = this.mWorldCenterMode.intValue; EditorGUILayout.PropertyField(this.mWorldCenterMode, new GUIContent("World Center Mode"), new GUILayoutOption[0]); if (this.mWorldCenterMode.intValue != intValue) { VuforiaAbstractConfiguration vuforiaAbstractConfiguration = VuforiaAbstractConfigurationEditor.LoadConfigurationObject(); if (this.mWorldCenterMode.intValue == 3) { vuforiaAbstractConfiguration.DeviceTracker.AutoInitAndStartTracker = true; PlayModeEditorUtility.Instance.ShowErrorInMouseOverWindow("Device tracker will start automatically. See Device Tracker Configuration."); } else if (intValue == 3) { vuforiaAbstractConfiguration.DeviceTracker.AutoInitAndStartTracker = false; PlayModeEditorUtility.Instance.ShowErrorInMouseOverWindow("Device tracker won't be started. See Device Tracker Configuration."); } } return((VuforiaARController.WorldCenterMode) this.mWorldCenterMode.intValue); }
public static void EditorConfigureTarget(ReconstructionAbstractBehaviour rb, SerializedObject serializedObject = null) { if (rb == null) { Debug.LogError("ReconstructionAbstractBehaviour parameter is null !"); return; } if (VuforiaUtilities.GetPrefabType(rb) == PrefabType.Prefab) { return; } if (!SceneManager.Instance.SceneInitialized) { SceneManager.Instance.InitScene(); } if (serializedObject == null) { serializedObject = new SerializedObject(rb); } if (!EditorApplication.isPlaying) { serializedObject.Update(); SerializedProperty serializedProperty = serializedObject.FindProperty("mInitializedInEditor"); if (!serializedProperty.boolValue) { Debug.Log("Reconstruction added to scene, enabling SmartTerrainTracker"); VuforiaAbstractConfiguration expr_6F = VuforiaAbstractConfigurationEditor.LoadConfigurationObject(); expr_6F.SmartTerrainTracker.AutoInitAndStartTracker = true; expr_6F.SmartTerrainTracker.AutoInitBuilder = true; using (serializedObject.Edit()) { serializedObject.FindProperty("mMaximumExtentEnabled").boolValue = false; serializedProperty.boolValue = true; } } } }
public static void Init() { Selection.activeObject = VuforiaAbstractConfigurationEditor.LoadConfigurationObject(); }