10using System.Collections.Generic;
25 public void ConstrainValue(SerializedProperty property) {
26 if (property.propertyType == SerializedPropertyType.Float) {
27 property.floatValue = Mathf.Min(
maxValue, property.floatValue);
28 }
else if (property.propertyType == SerializedPropertyType.Integer) {
29 property.intValue = Mathf.Min((
int)
maxValue, property.intValue);
30 }
else if (property.propertyType == SerializedPropertyType.Vector2) {
31 property.vector2Value = Vector2.Min(
new Vector2(
maxValue,
maxValue), property.vector2Value);
32 }
else if (property.propertyType == SerializedPropertyType.Vector3) {
34 }
else if (property.propertyType == SerializedPropertyType.Vector4) {
39 public override IEnumerable<SerializedPropertyType> SupportedTypes {
41 yield
return SerializedPropertyType.Integer;
42 yield
return SerializedPropertyType.Float;
43 yield
return SerializedPropertyType.Vector2;
44 yield
return SerializedPropertyType.Vector3;
45 yield
return SerializedPropertyType.Vector4;