Sync System: root object added listener does not raise events properly
See original GitHub issueI’m just having trouble getting a listener on the root object to raise events properly.
RootSyncObject = SharingStage.Instance.Manager.GetRootSyncObject();
objElementAdapter = new ObjectElementAdapter();
objElementAdapter.ElementAddedEvent += OnElementAdded;
objElementAdapter.ElementDeletedEvent += OnElementDeleted;
RootSyncObject.AddListener(objElementAdapter);
I’m getting the root object and adding a listener but that listener never raises ElementAddedEvent
nor ElementDeletedEvent
.
Here’s the branch I’ve set up for proper testing: https://github.com/HodgsonSDAS/HoloToolkit-Unity/tree/SyncSystemTests
- Open
SyncSystemTests.unity
- Add breakpoints to
ObjectElementAdapter.cs
lines 34, 123, & 137. - Start Debugging in visual studio and attach to Unity Editor.
- Run the
SyncSystemTest.unity
scene. - Create/Delete object object and int elements.
- Increment and decrement int value.
- Observe events not raised.
Issue Analytics
- State:
- Created 7 years ago
- Comments:16 (16 by maintainers)
Top Results From Across the Web
Set listener for store events in a controller - javascript
Try something like 'widgetname gridPanel #store' (where widgetname is for the view assigned to the controller). I don't have something to test ...
Read more >Spring Boot Application Events Explained
Spring Boot allows us to throw and listen to specific application events that we can process as we wish. Events are meant for...
Read more >Event listeners not working? 3 key areas to troubleshoot
Are your event listeners not working as you'd expect? Here are 3 key areas to troubleshoot to help you get everything triggering as...
Read more >Domain events: Design and implementation
Alternately, you can have the aggregate root subscribed for events raised by members of its aggregates (child entities).
Read more >6 Handling Events
This chapter describes how to handle events on the server as well as on the client.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh, local changes do not raise events on the local client. Events only get raised by remote client changes. You need to keep any local modifications done to intValueText.text.
D’oh, looks like it was. Pull request makes much more sense! Done. You should see the add/delete event for ObjectElements too, but I didn’t test that. Only investigated the IntElement for you.
Note that for every ObjectElement you need to AddListener to receive that ObjectElement’s events. The change events don’t propagate up to the root.