public SimpleNumericPropertyHandler(GetNumericProperty <T> GetValue, SetNumericProperty <T> SetValue, float delta) : base((b) => new NumberPrimitive(GetValue(b)), (b, v) => { if (v.GetType() != PrimitiveType.NUMERIC) { throw new Exception("Cannot assign non-number to this property"); } SetValue(b, (float)v.GetValue()); }, new NumberPrimitive(delta)) { }
public SimpleNumericPropertyHandler(GetNumericProperty <T> GetValue, SetNumericProperty <T> SetValue, float delta) : base((b, p) => new NumberPrimitive(GetValue(b)), (b, p, v) => { SetValue(b, CastNumber(v).GetTypedValue()); }, new NumberPrimitive(delta)) { }