Enemy Prefabs and variants – Configuring with SOs
Instead of a GameObject that has to live in a scene, we can create a file-based asset that can be referenced from any GameObject, including Prefabs, anywhere in the game, called an SO.
This being a single asset reference means no additional allocations are needed, and the same values are used no matter how many objects in the scene are spawned that reference it. Pretty cool!
An SO, as a small and efficient data container, also allows the separation of data from the code that consumes it. Data can be updated from backend cloud systems without recompiling the code or building a new distribution of the entire game.
Being able to respond to data changes for games in production – where an issue affecting players may need to be solved quickly – is an excellent application of SOs.
Others have used SOs for middleware components and even fully decoupled event systems that are designer-friendly because they allow...