![]() I’m still working on it but I’ll make sure to write another article/guide when I make any significant progress. I did stumble into some hurdles and errors here and there while trying to make a simple NPC generator. Blob Assets are a great way of storing data when working with Unity’s DOTS and there are still a lot to learn. This is just the creation logicĪnd that’s it. since that is already handled in the BlobAssetUtils. We don't have to worry about "storing" the created array to the blob asset here Public class TestGameDataSystem : GameObjectConversionSystem ") ![]() The decks would be pre made in the editor, and could then be accessed at runtime from monobehaviours. If you’re encountering this error (I encountered this with the packages – Entities 0.17.0-preview.42 and Hybrid Renderer 0.11.0-preview.44 – other dependent packages should update accordingly): What are scriptable objects actually good for So, in this official Unity tutorial, scriptable objects are being discussed: One highlighted use case is that scriptable objects could be used to store decks in a card game. ![]() Jumping in, the best use case for Blob Assets is converting Scriptable Objects (designer-friendly and can be edited in Unity’s editor) to data that can be used in your jobs with burst. The code here is stable with the packages – Entities 0.16.0-preview.21 and Hybrid Renderer 0.8.0-preview.19. Also, check Unity’s test scripts regarding Blob Assets, they help a lot in understanding how things work.īefore we start – for context, I’m making an NPC generator as a test project for studying ECS. And Code Monkey created an easy-to-understand video, “What are Blob Assets?”. If you want to learn more about getting started with blob assets, Marnel from Squeaky Wheel wrote a guide to help you out. It’s also important to note that you can only use blittable types in your blob assets, and BlobString or FixedString if you want to use strings. Meaning, you can use these in running parallel jobs, which is really important for creating performant systems using Unity’s DOTS. Today, I’m going to share with you how to convert scriptable objects to Blob Assets and also share a utility class that I created while studying Blob Assets.įirst off, let’s quickly define what is a blob asset – it’s an immutable data that can be accessed by your systems across multiple threads. So, you want to convert scriptable objects to data that you can use in your ECS systems – but, you can’t directly access SOs using pure ECS.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |