Exemplo n.º 1
0
        /// <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();
        }
Exemplo n.º 2
0
 /// <summary>
 /// Checks the correctness of the entered data.
 /// </summary>
 public virtual void ValidateValues()
 {
     upgradeCost = Math.Max(0, upgradeCost);
     unitParameters.ValidateValues();
 }