Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
class MyComponent extends FEntityComponent  {
	var _eventsmyVar:DynamicFloat;
	public function new(){
		super();
		
	}
	override public function init(config:DynamicFConfig){
		if(Reflect.isObject(config.events)){
			_events = config.events;
		}else{
			throw "events property missing for sound component";
		_myVar = config.get("myVar",Float,0);
		//Same, but without validation or default:
		_myvar = config["myVar"];
		//can also write with array access:
		config["myVar"] = 2.5;
	}
}