Esempio n. 1
0
        public void Execute(UpgradeComponent upgradeComponent, float percentageToUpgrade)
        {
            Automation data = upgradeComponent.AutomationData;

            data.PowerUpPercentage += percentageToUpgrade;
            data.CurrentDamage     += Mathf.RoundToInt(data.CurrentDamage * percentageToUpgrade * .01f);
        }
Esempio n. 2
0
        public void Execute(UpgradeComponent upgradeComponent, float percentageToUpgrade)
        {
            AutomationsData automationsData = upgradeComponent.AutomationsData;

            automationsData.ClickPowerPercentageIncrease += percentageToUpgrade;
            automationsData.ClickPower +=
                Mathf.RoundToInt(automationsData.AutomationsPower * percentageToUpgrade * .01f);
        }
        private AutomationUpgradeComponentPresenter InitializeSkill(string skillPath, IAutomationCommand skillCommand,
                                                                    UpgradeComponentData skillData)
        {
            try
            {
                var skillPrefab = Resources.Load <AutomationUpgradeComponentPresenter>(skillPath);
                skillPrefab.SetUpgradeComponentData(skillData);
                var _ = new UpgradeComponent(_playerData, _automationsData, _automation, skillData,
                                             skillCommand,
                                             skillPrefab);

                return(skillPrefab);
            }
            catch (Exception e)
            {
                Debug.LogError("Something wrong with skill initialization:");
                Debug.LogError(e);
            }

            return(null);
        }