Esempio n. 1
0
    public void DecreaseHpByWolf(int cnt, TrainingWolf wolf = null)
    {
        if (state == EnemyState.die || state == EnemyState.hit)
        {
            return;
        }
        hp      -= cnt;
        oldState = state;
        state    = EnemyState.hit;
        velocity = 0;
        EnemyExplosion enemyExplosion = GetComponentInChildren <EnemyExplosion>();

        enemyExplosion.isEnemyAtked = true;
        if (wolf != null)
        {
            enemiesManager.AtkReward(atk, wolf);
            Runaway(wolf.gameObject);
        }

        if (hp <= 0)
        {
            //Debug.Log("주겄당!!");
            if (wolf != null)
            {
                enemiesManager.DieReward(wolf);
            }
            state       = EnemyState.die;
            oldRotation = transform.rotation;
            animator.SetTrigger("dieTrigger");
        }
    }
Esempio n. 2
0
 public void AtkReward(int atk, TrainingWolf wolf)
 {
     trainWolfAgent = wolf;
     if (trainWolfAgent == null)
     {
         Debug.Log("EnemiesManager - Wolf Agent is null.");
         return;
     }
     trainWolfAgent.EnemyAtkReward(atk);
 }
Esempio n. 3
0
 public void DieReward(TrainingWolf wolf)
 {
     trainWolfAgent = wolf;
     if (trainWolfAgent == null)
     {
         Debug.Log("EnemiesManager - Wolf Agent is null.");
         return;
     }
     trainWolfAgent.EnemyDieReward();
 }