private void SectionAppearance() { GUILayout.Label("Appearance", "HeaderLabel"); using (MadGUI.Indent()) { FieldSetNativeSize(); EditorGUILayout.Space(); MadGUI.PropertyField(repeatCount, "Repeat Count"); MadGUI.PropertyFieldVector2(repeatPositionDelta, "Icons Distance"); MadGUI.PropertyField(repeatRotation, "Rotation"); using (MadGUI.Indent()) { MadGUI.PropertyField(repeatKeepOrientation, "Keep Orientation"); MadGUI.PropertyField(repeatKeepPosition, "Keep Position"); } EditorGUILayout.Space(); MadGUI.PropertyFieldEnumPopup(growType, "Grow Type"); using (MadGUI.EnabledIf(growType.enumValueIndex == (int)RepeatedRendererUGUI.GrowType.Fill)) { var index = growDirection.enumValueIndex; EditorGUI.BeginChangeCheck(); index = MadGUI.DynamicPopup(index, "Fill Direction", Enum.GetNames(typeof(EnergyBarBase.GrowDirection)).Length - 1, i => { return(SplitByCamelCase(Enum.GetNames(typeof(EnergyBarBase.GrowDirection))[i])); }); if (EditorGUI.EndChangeCheck()) { growDirection.enumValueIndex = index; } } FieldLabel2(); } }
private void FieldGrowDirection() { List<EnergyBarBase.GrowDirection> alloweDirections = new List<EnergyBarBase.GrowDirection>(); alloweDirections.Add(EnergyBarBase.GrowDirection.LeftToRight); alloweDirections.Add(EnergyBarBase.GrowDirection.RightToLeft); alloweDirections.Add(EnergyBarBase.GrowDirection.BottomToTop); alloweDirections.Add(EnergyBarBase.GrowDirection.TopToBottom); alloweDirections.Add(EnergyBarBase.GrowDirection.ExpandHorizontal); alloweDirections.Add(EnergyBarBase.GrowDirection.ExpandVertical); alloweDirections.Add(EnergyBarBase.GrowDirection.ColorChange); int selected = alloweDirections.FindIndex(direction => direction == renderer.growDirection); EditorGUI.BeginChangeCheck(); selected = MadGUI.DynamicPopup(selected, "Grow Direction", alloweDirections.Count, i => { return SplitByCamelCase(alloweDirections[i].ToString()); }); if (EditorGUI.EndChangeCheck()) { growDirection.enumValueIndex = (int) alloweDirections[selected]; } }