public override void OnInspectorGUI() { EditorGUILayout.PropertyField(source); ScreenConfigConnectionHelper.DrawGui("Settings", settingsList, ref settingsFallback, DrawSettings); if (showMinWidth) { ScreenConfigConnectionHelper.DrawSizerGui("Min Width", minWidthList, ref minWidthFallback); } if (showMaxWidth) { ScreenConfigConnectionHelper.DrawSizerGui("Max Width", maxWidthList, ref maxWidthFallback); } if (showMinHeight) { ScreenConfigConnectionHelper.DrawSizerGui("Min Height", minHeightList, ref minHeightFallback); } if (showMaxHeight) { ScreenConfigConnectionHelper.DrawSizerGui("Max Height", maxHeightList, ref maxHeightFallback); } ScreenConfigConnectionHelper.DrawSizerGui("Padding", paddingList, ref paddingFallback); }
public override void OnInspectorGUI() { BetterImage img = target as BetterImage; base.serializedObject.Update(); this.SpriteGUI(); EditorGUILayout.Separator(); if (img.type == Image.Type.Filled) { // coloring and materials not (yet) supported for filled images EditorGUILayout.PropertyField(this.m_Color); EditorGUILayout.PropertyField(this.m_Material); } else { // draw color and material materialDrawer.DrawInspectorGui(base.m_Material); } EditorGUILayout.Separator(); base.RaycastControlsGUI(); this.m_ShowType.target = this.m_Sprite.objectReferenceValue != null; if (EditorGUILayout.BeginFadeGroup(this.m_ShowType.faded)) { this.TypeGUI(); } EditorGUILayout.EndFadeGroup(); this.SetShowNativeSize(false); if (EditorGUILayout.BeginFadeGroup(this.m_ShowNativeSize.faded)) { EditorGUI.indentLevel = EditorGUI.indentLevel + 1; EditorGUILayout.PropertyField(this.m_PreserveAspect, new GUILayoutOption[0]); EditorGUI.indentLevel = EditorGUI.indentLevel - 1; } EditorGUILayout.EndFadeGroup(); base.NativeSizeButtonGUI(); base.serializedObject.ApplyModifiedProperties(); if (img.type == UnityEngine.UI.Image.Type.Sliced) { var prop = serializedObject.FindProperty("keepBorderAspectRatio"); EditorGUILayout.PropertyField(prop); serializedObject.ApplyModifiedProperties(); } if (img.type == Image.Type.Sliced || img.type == Image.Type.Tiled) { var prop = serializedObject.FindProperty("spriteBorderScaleFallback"); var collection = serializedObject.FindProperty("customBorderScales"); //EditorGUILayout.PropertyField(prop); ScreenConfigConnectionHelper.DrawSizerGui("Border Scale", collection, ref prop); serializedObject.ApplyModifiedProperties(); } }
public override void OnInspectorGUI() { base.DrawPaddingAndSpacingConfigurations(); ScreenConfigConnectionHelper.DrawGui("Settings", base.settingsConfigs, ref base.settingsFallback, base.DrawSettings); serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { ScreenConfigConnectionHelper.DrawGui("Settings", settingsList, ref settingsFallback, DrawSettings, AddSettings, DeleteSettings); if (layoutPriority != null) // Unity 2017+ { EditorGUILayout.PropertyField(layoutPriority); } }
public override void OnInspectorGUI() { bool tmp = activator.EditorPreview; activator.EditorPreview = EditorGUILayout.ToggleLeft("Editor Preview", activator.EditorPreview); if (activator.EditorPreview && tmp != activator.EditorPreview) { activator.Apply(); } ScreenConfigConnectionHelper.DrawGui("Settings", settingsList, ref settingsFallback, DrawSettings); }
private void AddSettings(string configName, SerializedProperty property) { foreach (var kv in allSizers) { SerializedProperty sizersProp = FindSizer(configName, null, kv.Value); if (sizersProp == null) { SerializedProperty items = kv.Value.FindPropertyRelative("items"); SerializedProperty fallback = kv.Key; ScreenConfigConnectionHelper.AddSizerToList(configName, ref fallback, items); } } // after adding the fallback values are pointing somewhere because of copying of all properties RestoreSizerFallbackReferences(); }
public override void OnInspectorGUI() { ScreenConfigConnectionHelper.DrawSizerGui("Padding", paddingConfigs, ref paddingFallback); ScreenConfigConnectionHelper.DrawSizerGui("Spacing", spacingConfigs, ref spacingFallback); ScreenConfigConnectionHelper.DrawSizerGui("Cell Size", cellSizeConfigs, ref cellSizeFallback); ScreenConfigConnectionHelper.DrawGui("Settings", settingsConfigs, ref settingsFallback, DrawSettings); serializedObject.ApplyModifiedProperties(); //if(serializedObject.ApplyModifiedProperties()) //{ // GridLayoutGroup grid = target as GridLayoutGroup; //} }
public override void OnInspectorGUI() { var obj = base.target as BetterText; base.serializedObject.Update(); EditorGUILayout.PropertyField(this.text); EditorGUILayout.LabelField("Better Sizing", EditorStyles.boldLabel); ScreenConfigConnectionHelper.DrawSizerGui("Font Size", sizerCollection, ref sizerFallback); EditorGUI.indentLevel += 1; EditorGUILayout.PropertyField(fitting); EditorGUI.indentLevel -= 1; EditorGUILayout.LabelField("Character", EditorStyles.boldLabel); EditorGUI.indentLevel += 1; EditorGUILayout.PropertyField(font); EditorGUILayout.PropertyField(style); EditorGUILayout.PropertyField(lineSpace); EditorGUILayout.PropertyField(rich); EditorGUI.indentLevel -= 1; EditorGUILayout.LabelField("Paragraph", EditorStyles.boldLabel); EditorGUI.indentLevel += 1; //EditorGUILayout.PropertyField(align); DrawAnchorIcons(align, obj.alignment); if (geoAlign != null) // not present in old unity versions { EditorGUILayout.PropertyField(geoAlign); } EditorGUILayout.PropertyField(overflowH); EditorGUILayout.PropertyField(overflowV); EditorGUI.indentLevel -= 1; base.AppearanceControlsGUI(); base.RaycastControlsGUI(); base.serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { EditorGUILayout.PrefixLabel("Live Update"); EditorGUILayout.BeginHorizontal(); autoPullFromTransform = GUILayout.Toggle(autoPullFromTransform, "↓ Auto-Pull", "ButtonLeft", GUILayout.MinHeight(30)); autoPushToTransform = GUILayout.Toggle(autoPushToTransform, "↑ Auto-Push", "ButtonRight", GUILayout.MinHeight(30)); EditorGUILayout.EndHorizontal(); if (autoPullFromTransform) { locator.CurrentTransformData.PullFromTransform(locator.transform as RectTransform); } ScreenConfigConnectionHelper.DrawGui("Rect Transform Override", transformConfigs, ref transformFallback, DrawTransformData); if (autoPushToTransform && !(pauseAutoPushOnce)) { locator.CurrentTransformData.PushToTransform(locator.transform as RectTransform); } pauseAutoPushOnce = false; }
public override void OnInspectorGUI() { ScreenConfigConnectionHelper.DrawSizerGui("Scale Settings", scaleSizerCollection, ref scaleSizerFallback); }
public override void OnInspectorGUI() { ScreenConfigConnectionHelper.DrawGui("Settings", settingsList, ref settingsFallback, DrawSettings); ScreenConfigConnectionHelper.DrawSizerGui("Size Delta Settings", deltaSizerCollection, ref deltaSizerFallback); }
public override void OnInspectorGUI() { ScreenConfigConnectionHelper.DrawGui("Settings", settingsList, ref settingsFallback, DrawSettings); }
protected void DrawPaddingAndSpacingConfigurations() { ScreenConfigConnectionHelper.DrawSizerGui("Padding", paddingConfigs, ref paddingFallback); ScreenConfigConnectionHelper.DrawSizerGui("Spacing", spacingConfigs, ref spacingFallback); }