Unit Data

public class UnitData : ScriptableObject

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

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

[SerializeField] UnitData data; // link to data. If your module derives from BaseUnitModule (or UnitLogicModule), you can use SelfUnit.Data to get it instead.

void Start()
{
  Debug.Log(data.Effects.WheelsRotationSpeed); // will print the 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 to add custom unit settings.

You can also override the UnitPrefabBuilder.SetupPrefab method (by deriving your own builder class from UnitPrefabBuilder) to add support for built-in prefab auto-generation for your new components or settings.