View on Asset Store (opens in new tab)
Package details
- Latest version
- 1.0.0
- Last updated
- First released
- Unity version
- 2019.4.24 or later
- Package size
- 692 KB
- Files
- 8
- Favorites
- 11
- Views in the past week
- 6
Price tracking
- Last checked
- Tracked since
- Lowest recorded
- Free on
Keywords
Thread - Sync
Thread - Sync is a quick and easy way for you to sync your Unity independent code and components with the Unity thread! It has a high potential to increase the performance of your solution.
Affiliate link · Purchases support this site
Price history
Last 6 months
USDAsset preview
1 / 6
Thread - Sync screenshot 1
About this asset
The Unity Engine is a powerful piece of software that makes a ton of awesome results possible. As long as you can stay in the Unity Eco System, you'll be fine. But since it is inevitable to have subsystems that run independently of the Unity thread but need to access it, a problem arises here.
Some examples of such subsystems are:
- Thread based systems
- Network based systems
- CAN / LIN / Serial Bus systems
- etc.
These systems operate at their own speed and thus must be synchronized with the Unity thread. If the systems are not synchronized, the interactions with Unity outside the thread will almost always not be invoked. There are “happy accidents” where the interactions go through, but randomness is mostly not the goal of programming.
The components of this asset help synchronize with the Unity thread.
Sync
With this component, it is possible to queue actions to be invoked once on the next call of the desired Unity update.
The supported updates are:
- Update()
- FixedUpdate()
- LateUpdate()
EventSync
With this component, it is possible to hook onto the desired Unity update with listeners.
The supported updates are:
- Update()
- FixedUpdate()
- LateUpdate()
Concluding
This asset is the result of many years of experience with Unity and its use outside of games.
From the publisher's Asset Store listing.
Technical details
Sync
- Enqueue actions that will be invoked once on the next call of the desired Unity update
EventSync
- Hook onto the desired Unity update with listeners
- Please use this component only if there is no other way and you really need it! It supports writing spaghetti code and cluttering the application
Benefits
- It is not necessary to reimplement existing code based on the Unity logic
- Boost in performance as you can save a lot of MonoBehaviours where each brought its own Update, FixedUpdate and LateUpdate implementation
- Adds a lot of flexibility as you can just write a single wrapper that will sync your code into Unity
- Each of the components disposes itself OnDestroy()
- All relevant methods are thread safe
- Build-In DontDestroyOnLoad functionality
- Clear Naming
Compatibility
| Unity version | Built-in | URP | HDRP | Custom |
|---|---|---|---|---|
| 2020.3.41f1 | Compatible | Compatible | Compatible | Compatible |
| 2019.4.24f1 | Compatible | Compatible | Compatible | Compatible |
No Scriptable Render Pipeline dependencies.
As listed on the Asset Store.