Notified when a specific SyncPrimitive changes
See original GitHub issueI am trying to understand how to setup sharing, while setting up an exploratory test I was wondering something. From what I can tell, if a SyncPrimitive child changes in a SyncObejct, the ObjectChanged flag will be fired. But does that ObjectChanged flag tell you which particular SyncPrimitive Child changed? Or does it just say, “hey, there was a change in the children”? Which is the way I think it works. Is that correct?
So based on above, if I want to be notified of which particular SyncPrimitive Changed, I wrap SyncBool in a SyncObject wrapper. Like this:
[SyncDataClass]
public class SyncNotifyingBool : SyncObject
{
[SyncData] public SyncBool IsActive;
}
Now I can be notified when individual SyncPrimitives Change in my SyncObejct class like:
[SyncDataClass]
public class SyncSpawnedTestContainer : SyncSpawnedObject
{
[SyncData] public SyncNotifyingBool IsAActive;
[SyncData] public SyncNotifyingBool IsBActive;
Is that generally the right idea overall?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Turn notifications on for list and list item changes
Stay up-to-date when lists or list items change by turning the Alert me setting on. Once turned on, you'll receive notifications with information...
Read more >Create an alert to get notified when a file or folder changes ...
In the Alert me when items change dialog, select and change the options you want. To save, select OK. Get alerts on all...
Read more >Get notified when a friend's location changes in Find My on ...
Get notified when a friend's location changes in Find My on iPhone. Use the Find My app to get a notification when your...
Read more >Manage your notifications - Computer - Google Docs ...
Manage notifications for edits. On files in Google Docs and Sheets, you can change settings to get notifications when others make changes.
Read more >Change notification settings on iPhone
In Settings on iPhone, choose which apps can send notifications, change the alert sound, allow government alerts, and more.
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
@Firifire here is the most stripped down version. Please post any improvement. Regards
Okay solved this issue by altering SyncSpawnedObject to inlcude a Syncbool.
This Syncbool (the datamodel) is then initialized before instantiation in the PrefabSpawnmanager like so:
and at the same time the TransformSynchronizer is being added I also find my script on my prefab called BoolSynchronizer using the GetComponentInChildren AND set its boolDataModel to the same we created earlier on Spawn
This is 90% the way there. The last 10% is writing your own BoolSynchronizer to do what you want with it and what happens when the variable changes. Took a few days of reading over the code again and again.