You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ActiveCollisionPublisher and ActiveCollisionConsumer provide a good, reusable generic pattern of one side of a contract (the publisher) being able to pass a payload on to any consumer and can be limited by any given rule.
At the moment the components only work with active collisions, but most of the code can be moved into an abstract class to offer other mechanisms.
E.g.
A more general GameObject Publisher/Consumer could be used by the Pointer to create interactable elements
E.g.
OnPointerSelected
-> Add Selected GameObject to Publisher List
-> Call Publish
if the selected GameObject has a Consumer then it can digest the method and do something.
Also, if it used an ObservableList to store the contents and the ObsList was updated to take a validity rule so only objects that are considered valid can be added to the obs list, then this would mean both the publisher and consumer could impose restrictions.
At the moment only the consumer can choose to ignore all publishers sending it a message.
The text was updated successfully, but these errors were encountered:
Adding the rule to the observable list wouldn't actually help here, because the publisher Add method would need to look up if the given object had any consumers on it to determine if to ignore or not. So it's the publisher that would have the rule, and if the rule exists then it simply wouldn't add it.
Because of this, it wouldn't be right to use an ObsList because you'd be able to bypass the rule check by going directly to the ObsList.
This actually makes it easier to implement the above suggestion.
The ActiveCollisionPublisher and ActiveCollisionConsumer provide a good, reusable generic pattern of one side of a contract (the publisher) being able to pass a payload on to any consumer and can be limited by any given rule.
At the moment the components only work with active collisions, but most of the code can be moved into an abstract class to offer other mechanisms.
E.g.
A more general GameObject Publisher/Consumer could be used by the Pointer to create interactable elements
E.g.
OnPointerSelected
-> Add Selected GameObject to Publisher List
-> Call Publish
if the selected GameObject has a Consumer then it can digest the method and do something.
Also, if it used an ObservableList to store the contents and the ObsList was updated to take a validity rule so only objects that are considered valid can be added to the obs list, then this would mean both the publisher and consumer could impose restrictions.
At the moment only the consumer can choose to ignore all publishers sending it a message.
The text was updated successfully, but these errors were encountered: