Esempio n. 1
0
    public void Disable()
    {
        Debug.Log(" trying to disable " + cat.Name);

        if (!enabled)
        {
            Debug.Log("already disabled " + cat.Name);
            return;
        }
        // StartCoroutine(changeZ());
        if (IAttack != null)
        {
            Debug.Log("STOP ATTACK " + cat.Name);
            StopCoroutine(IAttack);
        }
        if (cAttack != null)
        {
            cAttack.setOnHit(false);
        }
        if (!owner.enemy)
        {
            target = null;
        }
        stopWalk();
        blockedTime = 0;
        enabled     = false;
    }
Esempio n. 2
0
 //object pooling
 public void getAttackObj(ExploreCat enemyCat, float damage)
 {
     if (attackObjs.Count == 0)
     {
         CreateAttackObject(enemyCat, damage);
         return;
     }
     cAttack = attackObjs.Dequeue();
     cAttack.setOnHit(true);
     cAttack.setDamage(damage);
 }