Instantiate Object of Class for a list

I’ve created a little class to store my Moves, in a turn based combat system8922608--1222388--upload_2023-4-2_18-16-50.png

Now i want to add four moves to my player prefab, to test it, but i need to create them somehow?
8922608--1222391--upload_2023-4-2_18-18-16.png
I cant seem to create objects with a script that inherits the Move class cuz it wont add to the little list there.
I thought that i would have to just set the fields by hand in the list on the editor but it wants only a Move type object or something.
Empty Object with a script won’t do it, neither a prefab or simply just a script, so i’m lost here, what do i need to create to add there?

My guess is you don’t want Move to inherit from MonoBehaviour. So, either use scriptableObjects or just a regular class and use the SerializedField to make it so you can edit the fields in the editor. Otherwise, you’d have to attach a move script to your gameobject for each move they could do.

1 Like

In addition to the above, Unity does not serialize/show properties in the inspector. You have to create backing fields for them like:

public string MoveName => moveName;```
1 Like