예제 #1
0
    private void AttackEnemy()
    {
        if (!detectedEnemy)
        {
            return;
        }
        else if (currentTargets[0].gameObject.GetComponent <Entity>().isDead)
        {
            guiMessageText.SetText("Enemy neutralized!");
        }
        else if (currentTargets[0] != null && !currentGun.isEmpty)
        {
            currentGun.ShootGun();


            animationSoldier.SetShooting();
        }
        else if (currentGun.isEmpty)
        {
            currentGun.ReloadGun();
            guiMessageText.SetText("Reloading!");
        }
    }