public static void Draw(Vector3Property property, GUISkin skin, float minimumValue, float maximumValue) { using (new GUILayout.HorizontalScope(skin.FindStyle("Property"))) { property.SetRandomized( ToggleButtonDrawer.Draw( new GUIContent(skin.FindStyle("RandomManualIcons").hover.background), new GUIContent(skin.FindStyle("RandomManualIcons").normal.background), "This property is set to manual.", "This property is set to random.", skin.FindStyle("ToggleButton"), property.Randomized)); if (property.Randomized) { using (new GUILayout.HorizontalScope(skin.FindStyle("FieldValue"))) { EditorGUILayout.LabelField(property.Name, skin.label); property.SetMinMax( FloatValueDrawer.Draw( new GUIContent("Min"), property.Min, minimumValue, property.Max, skin, true), FloatValueDrawer.Draw( new GUIContent("Max"), property.Max, property.Min, maximumValue, skin, true)); } } else { property.SetValue( Vector3ValueDrawer.Draw(new GUIContent(property.Name), property.Value, skin)); } } }
public static Vector3 Draw(GUIContent label, Vector3 value, GUISkin skin) { Vector3 _fieldvalue = value; using (new GUILayout.HorizontalScope(skin.FindStyle("FieldValue"))) { EditorGUILayout.LabelField(label, skin.label); _fieldvalue.x = FloatValueDrawer.Draw(new GUIContent("x"), value.x, skin, true, 40, false); _fieldvalue.y = FloatValueDrawer.Draw(new GUIContent("y"), value.y, skin, true, 40, false); _fieldvalue.z = FloatValueDrawer.Draw(new GUIContent("z"), value.z, skin, true, 40, false); GUILayout.FlexibleSpace(); } return(_fieldvalue); }