Ejemplo n.º 1
0
        /// <summary>
        /// Инициализация характеристик ко-робля.
        /// </summary>
        private void InitializeAttributes()
        {
            var baseShipStats =
                UnitAttributes.Instance.ShipBaseAttributes.FirstOrDefault(stats => Sid.Contains(stats.Type));
            var shipStatsMultipliers =
                UnitAttributes.Instance.ShipAttributesMultipliers.FirstOrDefault(stats => stats.Type == Sid);

            if (baseShipStats == null || shipStatsMultipliers == null)
            {
                Debug.LogWarning($"Не удалось найти характеристики: {Sid}");
                return;
            }

            _currentHealth        = baseShipStats.Health * shipStatsMultipliers.Health;
            _currentShootingSpeed = baseShipStats.ShootSpeed * shipStatsMultipliers.ShootSpeed;
            _currentMovingSpeed   = baseShipStats.MoveSpeed * shipStatsMultipliers.MoveSpeed;
            _currentMobility      = baseShipStats.Mobility * shipStatsMultipliers.Mobility;
            _weaponDamage         = shipStatsMultipliers.WeaponDamage;
        }