public void IsValid_With_Incorrect_String() { object intObj = 2; var rngattr = new CustomRangeAttribute(3, 10); Assert.IsFalse(rngattr.IsValid(intObj)); }
public void IsValid_With_Null_Int() { object nullObj = null; var rngattr = new CustomRangeAttribute(3, 10); Assert.IsTrue(rngattr.IsValid(nullObj)); }
public void IsValid_With_Correct_Value() { object intObj = 8; var rngattr = new CustomRangeAttribute(3, 10); Assert.IsTrue(rngattr.IsValid(intObj)); }
public override bool Equals(object obj) { CustomRangeAttribute cra = obj as CustomRangeAttribute; if (cra == null) { return false; } return this.special.Equals(cra.special) && base.Equals(obj); }
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { CustomRangeAttribute rangAttr = (CustomRangeAttribute)attribute; if (property.propertyType == SerializedPropertyType.Float) { EditorGUI.Slider(position, property, rangAttr.min, rangAttr.max, label); } }