func (pe *Property) Bind(variable interface{}, valueType PropertyValueType) {
	var binder PropertyUpdateHandler
	switch valueType {
	case ValTypeInt:
		binder = func(val PropertyValue) {
			*(variable.(*int)) = val.IntVal
		}
	case ValTypeBoolInt:
		binder = func(val PropertyValue) {
			*(variable.(*bool)) = val.IntVal == 1
		}

	case ValTypeFloat32:
		binder = func(val PropertyValue) {
			*(variable.(*float32)) = val.FloatVal
		}

	case ValTypeFloat64:
		binder = func(val PropertyValue) {
			*(variable.(*float64)) = float64(val.FloatVal)
		}

	case ValTypeString:
		binder = func(val PropertyValue) {
			*(variable.(*string)) = val.StringVal
		}

	case ValTypeVector:
		binder = func(val PropertyValue) {
			*(variable.(*r3.Vector)) = val.VectorVal
		}

	case ValTypeArray:
		binder = func(val PropertyValue) {
			*(variable.(*[]PropertyValue)) = val.ArrayVal
		}
	}
	pe.OnUpdate(binder)
}
/*
Bind binds a property's value to a pointer.

Example:
	var i int
	Property.Bind(&i, ValTypeInt)

This will bind the property's value to i so every time it's updated i is updated as well.

The valueType indicates which field of the PropertyValue to use for the binding.
*/
Bind binds a property's value to a pointer.

var i int
Property.Bind(&i, ValTypeInt)

This will bind the property's value to i so every time it's updated i is updated as well.

The valueType indicates which field of the PropertyValue to use for the binding.
/ * Bind binds a property ' s value to a pointer . Example : var i int Property . Bind ( &i ValTypeInt ) This will bind the property ' s value to i so every time it ' s updated i is updated as well . The valueType indicates which field of the PropertyValue to use for the binding . * /
func (pe *Property) Bind(variable interface{}, valueType PropertyValueType) {
	var binder PropertyUpdateHandler
	switch valueType {
	case ValTypeInt:
		binder = func(val PropertyValue) {
			*(variable.(*int)) = val.IntVal
		}
	case ValTypeBoolInt:
		binder = func(val PropertyValue) {
			*(variable.(*bool)) = val.IntVal == 1
		}
	case ValTypeFloat32:
		binder = func(val PropertyValue) {
			*(variable.(*float32)) = val.FloatVal
		}
	case ValTypeFloat64:
		binder = func(val PropertyValue) {
			*(variable.(*float64)) = float64(val.FloatVal)
		}
	case ValTypeString:
		binder = func(val PropertyValue) {
			*(variable.(*string)) = val.StringVal
		}
	case ValTypeVector:
		binder = func(val PropertyValue) {
			*(variable.(*r3.Vector)) = val.VectorVal
		}
	case ValTypeArray:
		binder = func(val PropertyValue) {
			*(variable.(*[]PropertyValue)) = val.ArrayVal
		}
	}
	pe.OnUpdate(binder)
}
func ( pe * Property ) Bind ( variable interface { } , valueType PropertyValueType ) { var binder PropertyUpdateHandler switch valueType { case ValTypeInt : binder = func ( val PropertyValue ) { * ( variable . ( * int ) ) = val . IntVal } case ValTypeBoolInt : binder = func ( val PropertyValue ) { * ( variable . ( * bool ) ) = val . IntVal == 1 } case ValTypeFloat32 : binder = func ( val PropertyValue ) { * ( variable . ( * float32 ) ) = val . FloatVal } case ValTypeFloat64 : binder = func ( val PropertyValue ) { * ( variable . ( * float64 ) ) = float64 ( val . FloatVal ) } case ValTypeString : binder = func ( val PropertyValue ) { * ( variable . ( * string ) ) = val . StringVal } case ValTypeVector : binder = func ( val PropertyValue ) { * ( variable . ( * r3 . Vector ) ) = val . VectorVal } case ValTypeArray : binder = func ( val PropertyValue ) { * ( variable . ( * [ ] PropertyValue ) ) = val . ArrayVal } } pe . OnUpdate ( binder ) }
Bind binds a property's value to a pointer.
Bind binds a property ' s value to a pointer .