13 [AttributeUsage(AttributeTargets.Property)]
23 public float MinFloat {
get;
private set; }
24 public float MaxFloat {
get;
private set; }
25 public int MinInt {
get;
private set; }
26 public int MaxInt {
get;
private set; }
44 public override void DrawEditor(
UnityEngine.Object target, FieldInfo field, SerializedProperty property)
47 throw new NotImplementedException();
50 public override void DrawEditor(
UnityEngine.Object target, PropertyInfo prop)
52 if (prop.PropertyType == typeof(
int))
54 int propIntValue = (int)prop.GetValue(target, null);
55 propIntValue = EditorGUILayout.IntSlider(SplitCamelCase(prop.Name), propIntValue, MinInt, MaxInt);
56 prop.SetValue(target, propIntValue, null);
58 else if (prop.PropertyType == typeof(
float))
60 float propFloatValue = (float)prop.GetValue(target, null);
61 propFloatValue = EditorGUILayout.Slider(SplitCamelCase(prop.Name), propFloatValue, MinFloat, MaxFloat);
62 prop.SetValue(target, propFloatValue, null);