/// <summary> /// Checks the correctness of the entered data. /// </summary> protected virtual void OnValidate() { if (prefab == null) { Debug.LogWarning($"There is no {nameof(prefab)} in {unitName}"); } if (weaponData == null) { Debug.LogWarning($"There is no {nameof(weaponData)} in {unitName}"); } parameters.ValidateValues(); }
/// <summary> /// Checks the correctness of the entered data. /// </summary> public virtual void ValidateValues() { upgradeCost = Math.Max(0, upgradeCost); unitParameters.ValidateValues(); }