We need some system, so we can use some kind of extends in the scripting part.
Internally, this will just be a field that holds the struct we want to extend from. For example, if we have a UIEvent struct that we pass to js/Lua we will have a field event or parent with a Event. When creating the bindings, the Event's implement function will be executed before the UIEvents, which leads to the fields on the Object being correctly instantiated for all struct/classes we that we inherit from.
However, there needs to be a slightly different function, so we can also modify the Object's prototype accordingly.
We need some system, so we can use some kind of
extendsin the scripting part.Internally, this will just be a field that holds the struct we want to extend from. For example, if we have a
UIEventstruct that we pass to js/Lua we will have a fieldeventorparentwith aEvent. When creating the bindings, theEvent'simplementfunction will be executed before theUIEvents, which leads to the fields on the Object being correctly instantiated for all struct/classes we that we inherit from.However, there needs to be a slightly different function, so we can also modify the Object's prototype accordingly.