示例#1
0
        private void Start()
        {
            unit            = GetComponent <Unit>();
            damageBoostLvl  = DamageBoostLvl.Level0;
            defenseBoostLvl = DefenseBoostLvl.Level0;

            unit.onTimedAttack  += EvaluateDamageBoostLevel;
            unit.onTimedDefense += EvaluateDefenseBoostLevel;
            unit.parent.onDeath += OnDeath;
        }
示例#2
0
        private void EvaluateDefenseBoostLevel(bool condition)
        {
            if (condition)
            {
                if (defenseBoostLvl < DefenseBoostLvl.Level5)
                {
                    defenseBoostLvl += 1;
                }
            }
            else
            {
                defenseBoostLvl = DefenseBoostLvl.Level0;
            }

            unit.onDefValueChanged?.Invoke((int)defenseBoostLvl, condition);
        }