- edited description
Try to make usage of a binding in a DataBindingOperator easier
Issue #27
resolved
Right now there are 4 steps:
- AddBinding in Awake
- RemoveBinding in OnDestroy
- Add listener and initialization in OnEnable
- Remove listener in OnDisable
Some ideas for improvements:
- The logic in RemoveBinding could be done automatically on destruction.
- There should be an overload for AddBinding which takes a delegate which is called when the binding changed and on initialization.
- There might be a virtual method (AddBindings) that is called by the base class in Awake() instead of expecting the dev to remember that AddBinding calls have to be put in Awake()
Comments (8)
-
reporter -
reporter - edited description
-
reporter - removed milestone
-
reporter - marked as proposal
-
reporter The bindings are already removed automatically on deinitialization (OnDestroy).
-
reporter Having AddBinding to be called in Init() method is okay. There are enough examples that do it and once you know where to add bindings, it's clear. So there is no need for a special AddBindings() method.
-
reporter Added overload for AddBinding to provide an additional callback that should be invoked when the data binding value changed.
-
reporter - changed status to resolved
- Log in to comment