You will need to have a basic understanding of Unity and C#.
We will be using the following Unity engine and C# language concepts:
- Constructors
- ScriptableObjects
If you are unfamiliar with these concepts, please review Chapter 3, A Short Primer to Programming in Unity.
The code files for this chapter can be found on GitHub at https://github.com/PacktPublishing/Game-Development-Patterns-with-Unity-2021-Second-Edition/tree/main/Assets/Chapters/Chapter12.
Check out the following video to see the code in action:Â https://bit.ly/3r9rvJD.
We often use ScriptableObjects in the code examples in this book because we want to establish an authoring workflow for our designers to create new weapon attachments or configure existing ones without modifying a single line of code. It's good practice to make your systems, ingredients, and mechanics easy to configure for non-programmers.