public void AddPower(Transform enemy)
    {
        AI.EnemyBehaviour enemyScript = enemy.GetComponent <EnemyBehaviour>();

        if (!enemyScript)
        {
            return;
        }
        power += enemyScript.rewardedPower;

        if (power > powerMax)
        {
            power = powerMax;
        }
        Game.Hud.power.value = power;
    }
Пример #2
0
        public void AddSanity(Transform enemy)
        {
            AI.EnemyBehaviour enemyScript = enemy.GetComponent <EnemyBehaviour>();

            if (!enemyScript)
            {
                return;
            }
            _sanity += enemyScript.rewardedSanity;

            if (_sanity > Game.Hud.sanity.maxValue)
            {
                _sanity = (int)Game.Hud.sanity.maxValue;
            }
            Game.Hud.sanity.value = _sanity;
        }