コード例 #1
0
ファイル: Base.cs プロジェクト: abizzaar/EECS-396-Game-Design
    private void DealDamage(GameObject enemy)
    {
        if (enemy.tag == "normalEnemy")
        {
            if (_health < 5)
            {
                _health = 0;
            }
            else
            {
                _health -= 5;
            }

            healthBar.setHealth(_health);
        }
        if (enemy.tag == "fastEnemy")
        {
            if (_health < 1)
            {
                _health = 0;
            }
            else
            {
                _health -= 1;
            }

            healthBar.setHealth(_health);
        }
        if (enemy.tag == "slowEnemy")
        {
            if (_health < 10)
            {
                _health = 0;
            }
            else
            {
                _health -= 10;
            }

            healthBar.setHealth(_health);
        }
    }