public override void OnInspectorGUI() { serializedObject.Update(); var showHint = MarsHints.ShowMemoryOptionsHint; showHint = MarsEditorUtils.HintBox(showHint, k_GeneralHelpContent, "Memory options help"); MarsHints.ShowMemoryOptionsHint = showHint; m_MultiplierProperty.intValue = EditorGUILayout.IntSlider("Allocation Multiplier", m_MultiplierProperty.intValue, 1, 10); // being / end change check gives too many events, so manually detect changes if (m_PreviousSliderValue != m_MultiplierProperty.intValue) { UpdateObject(m_MultiplierProperty.intValue); serializedObject.ApplyModifiedProperties(); } m_PreviousSliderValue = m_MultiplierProperty.intValue; m_AdvancedEditing = EditorGUILayout.Toggle("Enable Advanced Editing", m_AdvancedEditing); if (m_AdvancedEditing) { EditorGUILayout.HelpBox(k_AdvancedEditHelpContent, MessageType.Warning); } using (new EditorGUI.DisabledScope(!m_AdvancedEditing)) { DrawDefaultInspector(); } serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { if (!EditorGUIUtility.wideMode) { EditorGUIUtility.wideMode = true; EditorGUIUtility.labelWidth = EditorGUIUtility.currentViewWidth - 212; } serializedObject.Update(); EditorGUILayout.PropertyField(m_Position, k_PositionContent); k_RotationFieldMethod.Invoke(m_RotationGUI, null); using (new EditorGUI.DisabledScope(ShouldDisableScaleTransformField())) { EditorGUILayout.PropertyField(m_Scale, k_ScaleContent); } using (new EditorGUI.DisabledScope(EditorApplication.isPlayingOrWillChangePlaymode)) { // Warning if global position is too large for floating point errors. // SanitizeBounds function doesn't even support values beyond 100000 var pos = m_Transform.position; var absX = pos.x > 0f ? pos.x : -pos.x; var absY = pos.y > 0f ? pos.y : -pos.y; var absZ = pos.z > 0f ? pos.z : -pos.z; if (absX > 100000 || absY > 100000 || absZ > 100000) { EditorGUILayout.Separator(); EditorGUILayout.HelpBox(k_FloatingPointWarning, MessageType.Warning); } } if (m_IsMarsSession) { EditorGUILayout.HelpBox(k_SessionScaleHint, MessageType.Info); } else { MarsEditorUtils.HintBox(m_IsMarsScene && MarsHints.ShowWorldScaleHint, k_WorldScaleHint, k_WorldScaleHintAnalyticsLabel, k_LearnAboutScale, MarsHelpURLs.WorldScaleHelpURL, k_StopShowingHints, () => { MarsHints.ShowWorldScaleHint = false; }); } if (m_SettingHideFlags) { MarsEditorUtils.HintBox(MarsHints.ShowDisabledSimulationComponentsHint, k_DisabledComponentHint, k_DisableComponentHintAnalyticsLabel, null, MarsHelpURLs.WorldScaleHelpURL, k_StopShowingHints, () => { MarsHints.ShowDisabledSimulationComponentsHint = false; }); } serializedObject.ApplyModifiedProperties(); }
void DrawEntitySetupWizard() { var drewWizard = true; if ((m_SelectedEntity as Replicator) != null) { drewWizard = false; } else if ((m_SelectedEntity as ProxyGroup) != null) { if (m_Relations.Count < 1 && m_MultiRelations.Count < 1) { MarsEditorUtils.HintBox(true, k_NoRelationWarning, k_NoRelation, k_LearnMoreSetsButton, MarsHelpURLs.ProxyGroupHelpURL, k_StopShowingEntityHints, () => { MarsHints.ShowEntitySetupHints = false; }); if (GUILayout.Button(k_WizardAddElevation)) { Undo.AddComponent <ElevationRelation>(m_SelectedEntity.gameObject); EditorEvents.UiComponentUsed.Send(new UiComponentArgs { label = k_AddElevationRelation }); } } } else if (m_Conditions.Count < 1 && m_MultiConditions.Count < 1) { MarsEditorUtils.HintBox(true, k_NoConditionsAssignedWarning, k_NoConditions, k_LearnMoreConditionsButton, MarsHelpURLs.ProxyConditionsHelpURL, k_StopShowingEntityHints, () => { MarsHints.ShowEntitySetupHints = false; }); if (GUILayout.Button(k_WizardAddPlaneSize)) { Undo.AddComponent <PlaneSizeCondition>(m_SelectedTransform.gameObject); EditorEvents.UiComponentUsed.Send(new UiComponentArgs { label = k_AddPlaneSizeCondition }); EntityVisualsModule.instance.InvalidateVisual(m_SelectedEntity); } } else { drewWizard = false; } if (drewWizard) { EditorGUILayout.Separator(); } }
public override void OnInspectorGUI() { serializedObject.UpdateIfRequiredOrScript(); using (var changeCheck = new EditorGUI.ChangeCheckScope()) { EditorGUILayout.PropertyField(m_RuleProperty); EditorGUILayout.PropertyField(m_GeoBoundsProperty); if (changeCheck.changed) { PropagateGeoLocationChanges(); } } var geoLocationModule = ModuleLoaderCore.instance.GetModule <GeoLocationModule>(); if (geoLocationModule != null && !geoLocationModule.autoStartLocationService) { EditorGUILayout.HelpBox("GeoLocation Service is NOT currently set to auto-activate." + " Turn it on in the GeoLocationModule.", MessageType.Info); } var showHint = MarsHints.ShowSimulatedGeoLocationHint; if (showHint) { showHint = MarsEditorUtils.HintBox(showHint, "You can set the simulated geolocation in the GeoLocationModule.", "SetSimLocationInGeoModule"); if (!showHint) { MarsHints.ShowSimulatedGeoLocationHint = showHint; } } if (GUILayout.Button("Go to GeoLocationModule")) { Selection.activeObject = geoLocationModule; } m_ShortcutButtonsFoldout = GeoLocationShortcutButtons.DrawShortcutButtons("Geolocation shortcuts", (latitude, longitude) => { m_Latitude.doubleValue = latitude; m_Longitude.doubleValue = longitude; PropagateGeoLocationChanges(); }, true, m_ShortcutButtonsFoldout); serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { serializedObject.Update(); m_ShowHelp = MarsEditorUtils.HintBox(m_ShowHelp, k_HelpText, "PipelineFenceConfiguration"); var module = ModuleLoaderCore.instance.GetModule <QueryPipelinesModule>(); var stageInstances = module?.StandalonePipeline?.Stages; m_ShowFrameBudgetsFoldout = EditorGUILayout.Foldout(m_ShowFrameBudgetsFoldout, "Stage Frame Budgets", true); if (m_ShowFrameBudgetsFoldout) { for (var i = 1; i < m_FrameBudgetsProperty.arraySize; i++) { var prop = m_FrameBudgetsProperty.GetArrayElementAtIndex(i); var label = stageInstances == null?i.ToString() : stageInstances[i].Label; EditorGUILayout.PropertyField(prop, new GUIContent(label)); } } m_ShowWeightsHelp = MarsEditorUtils.HintBox(m_ShowWeightsHelp, k_SetOrderText, "SetOrderConfiguration"); m_ShowOrderWeightFoldout = EditorGUILayout.Foldout(m_ShowOrderWeightFoldout, "Set Order Weighting", true); if (m_ShowOrderWeightFoldout) { EditorGUILayout.Slider(m_ReservedMemberWeightProperty, GroupOrderWeights.MinReservedWeight, GroupOrderWeights.MaxReservedWeight); EditorGUILayout.Slider(m_SharedMemberWeightProperty, GroupOrderWeights.MinSharedWeight, GroupOrderWeights.MaxSharedWeight); EditorGUILayout.Slider(m_RelationWeightProperty, GroupOrderWeights.MinRelationWeight, GroupOrderWeights.MaxRelationWeight); } m_ShowCurveHelp = MarsEditorUtils.HintBox(m_ShowCurveHelp, k_SearchCurveText, "SearchCurveConfig"); EditorGUILayout.PropertyField(m_SearchCurveProperty); EditorGUILayout.Separator(); serializedObject.ApplyModifiedProperties(); }