コード例 #1
0
    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
ファイル: Bed.cs プロジェクト: PaulBichler/BedtimeIsDeadtime
        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;
        }