ExtendRealityLtd / ExtendRealityLtd/Zinnia.Unity

Make ActiveCollisionPublisher/Consumer extend generic class

Open
#432 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C#
Stars
321
Forks
36
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.