The architecture is set. It’s time to code.
But first let’s summarize what needs to be done:
Creating my system (listed in no particular order):
- Create SpellFactory function that takes in the JSON input to create prefabs and SpellData SO
- Create SpellBehavior that reads Triggers and Events and performs actions
- Also reads SpellData SO and moves spell accordingly
- Create SpellDataSO
- Ensure it has an array or something to hold Triggers and Events
- Have a location for visual prefabs
- Create SpellEnum (mapping from ID to spell prefab)
Creating the spellcasting (again in no particular order)
- (Server) Get spell prefab from SpellEnum
- Spawns spell… I guess that’s it
Future/Things to look out for:
- Testing — ScriptableObjects, Spells, etc won’t exist until runtime once the full loop (JSON → SpellFactory → SpellData SO, prefab, dynamic triggers/events) is working
- Make the ability to create ScriptableObjects, Spells, during testing and have them persist after runtime
- Enable some kind of testing environment when passed in a JSON or something
- I’d also want some unit tests for SpellData and stuff
- Ensure prefabs hold SpellData, not the other way around (like I have been doing)
- Consider how expensive it is to create a spell and handle spell behavior