If you need to store multiple elements of the same type, you would normally create a list or array. But this doesn't work with DOTS. Instead of creating a list, you need to create a dynamic buffer that you can later add to the entity the same way as you would add a component.
👍 Like and 🔔Subscribe for More Unity and C# Tutorials https://www.youtube.com/@UClTnTUyCeSu9tN8FNNoXMRg
🌟 Support My Work and Unlock Exclusive Content! 🌟
👉 Patreon: https://www.patreon.com/FreedomCoding
🎮 Join Our Developer Community!
💬 Discord: https://discord.gg/JzssYyjvGu
💖 Support Me Financially
☕ PayPal, Revolut: [email protected]
Are you looking for a Unity/C# tutor? Contact me here - [email protected]
Website - https://www.freedom-coding.com
Timestamps:
00:00 Why To Use Dynamic Buffers?
00:25 Inventory System
01:05 Creating Buffer Element
02:32 Adding Buffer To Entity
03:29 Adding Elements To Buffer
05:04 Randomizing Item ID
05:45 Changing Values Of Element Variables
07:14 Result
07:45 Dynamic Buffers In Jobs
08:23 Waypoints Example