/// <summary> /// Draws two integer properties, using the validator to process the new values. /// </summary> /// <param name="label">Label.</param> /// <param name="propA">Property a.</param> /// <param name="propB">Property b.</param> /// <param name="validator">Validator.</param> public static void Validate2IntField(GUIContent label, SerializedProperty propA, SerializedProperty propB, Func <int, int> validator) { Rect position = EditorGUILayout.GetControlRect(true); HydraEditorUtils.Validate2IntField(position, label, propA, propB, validator); }
/// <summary> /// Draws a float field for a property, using the validator to process the new value. /// </summary> /// <param name="label">Label.</param> /// <param name="prop">Property.</param> /// <param name="validator">Validator.</param> public static void ValidateFloatField(GUIContent label, SerializedProperty prop, Func <float, float> validator) { Rect position = EditorGUILayout.GetControlRect(true); HydraEditorUtils.ValidateFloatField(position, label, prop, validator); }
public static string SaveFileField(GUIContent label, string path, string extention) { Rect position = EditorGUILayout.GetControlRect(true); return(HydraEditorUtils.SaveFileField(position, label, path, extention)); }
/// <summary> /// Draws a layer mask field. /// </summary> /// <param name="label">Label.</param> /// <param name="prop">Property.</param> /// <param name="style">Style.</param> public static void LayerMaskField(GUIContent label, SerializedProperty prop, GUIStyle style) { Rect position = EditorGUILayout.GetControlRect(true); HydraEditorUtils.LayerMaskField(position, label, prop, style); }
/// <summary> /// Draws a float field with 2 decimal places. /// </summary> /// <returns>The new value.</returns> /// <param name="label">Label.</param> /// <param name="value">Value.</param> public static float FloatField2Dp(GUIContent label, float value) { Rect position = EditorGUILayout.GetControlRect(true); return(HydraEditorUtils.FloatField2Dp(position, label, value)); }
/// <summary> /// Shorthand enum popup field with a style. /// </summary> /// <param name="label">Label.</param> /// <param name="prop">Property.</param> /// <param name="style">Style.</param> /// <typeparam name="T">The enum type.</typeparam> public static void EnumPopupField <T>(GUIContent label, SerializedProperty prop, GUIStyle style) { Rect position = EditorGUILayout.GetControlRect(true); HydraEditorUtils.EnumPopupField <T>(position, label, prop, style); }
/// <summary> /// Draws a Vector3 field. For some reason Unity throws an error with vector3 property /// fields, so this is a workaround. /// </summary> /// <param name="label">Label.</param> /// <param name="prop">Property.</param> public static void Vector3Field(GUIContent label, SerializedProperty prop) { Rect position = EditorGUILayout.GetControlRect(true); HydraEditorUtils.Vector3Field(position, label, prop); }