Is it possible to create game object/prefab from file?

I have already finished some unity tutorials. Currently using ‘2D Roguelike’ as a base for some experiments to learn. What boardManager does(creating map, zombies and stuff), making prefabs, addind animations etc. is clear to me, but I wonder how could I be able to to make it in files(like easy modding). For example let’s say I get rid of zombies from my prefabs, and instead I want game to start like:
1.Open file enemies.xml(or any other file type, nevermind).
enemies.xml like:

    <enemies>
       <zombie1>
          <health>10</health>
          <spritefile>zombie1</spritefile>
       </zombie1>
    </enemies>

2.Creates new prefab already containing collider, rigidbody and attached script, making zombie health 10, and loading sprites from files ‘zombie1attack.png’, ‘zombie1idle.png’.
3.Adds all the enemies to boardManager, so it can spawn them around.

And making same thing with floors, walls, load from file, load relevant png and make it a prefab, which boardManager uses.

How hard is it to create a script interpreting file and creating enemy with rigidbody, collider, attached script and animations basing only on that file contents and sprites? I’d be grateful for any advices on how to start it or maybe tutorials about that?

Also a little question, when I should inherit from MonoBehaviour and when I shouldn’t?

Interesting question. I am not sure there is a clean way to create prefabs from scratch via code. What you could do is to write something to fetch all files in a path in a given format(xml, for example), and for each file read, you instantiate a template prefab, and set stuff like health or sprites from the file read.

Let me give you some starting points:

StreamingAssets are good for adding stuff in the player’s file system:

If your want to facilitate the modding for custom abilities read about delegates

(some people find it to be quite advanced)

You can store info into a Scriptable Object. Think of them as data containers for all of your enemies information. As they are a asset, they don’t use too much memory

This is easily done, you want to create a entity (Class) that can populate XML data to the class.