Unit Data

public class UnitData : ScriptableObject

This class contains info about unit, like price, max health, attack distance, etc. A lot of parameters can be found here. How to use it, you can read in Guide. Here only information about code.

To get some parameter from the UnitData, you simple can do this:

[SerializeField] UnitData data; // link to data. If you derived your class from Module, you can use SelfUnit.Data to get it.

void Start()
{
  Debug.Log(data.WheelsRotationSpeed); // will print WheelsRotationSpeed parameter value in console.
}

If you’re extending your game, you can derive your CustomUnitData class from UnitData, and add your own fields to it, if you need add custom unit settings.

You also can override its SetupPrefab method, to add support of built-in prefab auto-generation for your new components or settings.