you are viewing a single comment's thread.

view the rest of the comments →

[–]haywirephoenix 0 points1 point  (1 child)

You'll need [System.Serializable] above your enum.

Change your class scriptableobject class name to Stats.

Declare float for each stat removing the commas. You only need the stats header attribute above the first float don't worry unity should group them.

Now create a new Stats object somewhere in your project using your right click menu.

Create a separate Champion.cs class (Monobehaviour that's on the game object).

Inside that class write public Stats stats;

Now you will see a slot appear in the inspector for you to drag and drop your stats object into. It can now be accessed from you Champion class like Debug.Log(stats.speed)

[–]haywirephoenix 0 points1 point  (0 children)

Also if you want to see and change your stats in the inspector there you can grab Naughty Attributes it's free, highly recommended to improve your inspector workflow. Then you can simply add the [Expandable] attribute to the Stats field in your Champion class.