I’m wondering how I can store information in a file that I can load at runtime.
Some details : I’m creating an RPG, which is very content heavy with numerous items, abiltiies, animations, etc. and I’m coming from an XNA background where everything was stored in xml - which made storing full objects super easy.
I understand the concept of (and use) Prefabs for game objects, such as Enemy/Monster objects and Items, however I haven’t been able to wrap my head around how to store things like abilities and animations.
An ability/skill/spell, whatever you want to call it will have a list of values and traits which make it unique, but it doesn’t make sense to create a prefab object to hold those values. The idea would be to have an AbilityScript that would load X ability at runtime from a file. I’m curious how that storage and loading would work.
I was thinking of just continuing to use XML, but I’m not sure if Unity has a similar importer to XNA. XNA’s content pipeline and ContentManager class made it very easy to load resources at runtime.
So in summary:
- How can I store a representation of a class object (Ability.cs) in a file that I can later load at runtime?
- If the answer to the above is XML, what resources are there to load xml at runtime without making a big switch statement parser?
- Whatever format is chosen (xml?), are the contents stored as plain text when I release a build? How do I prevent tampering with the resource files?