private void Awake()
 {
     //coll = GetComponent<Collider>();
     Owner           = GetComponentInParent <ShieldEnemy>();
     Owner.OnDie    += () => { coll.enabled = false; };
     Owner.onGetHit += () => { coll.enabled = false; };
 }
Ejemplo n.º 2
0
    private void GetShieldEnemy(Collider other)
    {
        ShieldEnemy shieldEnemy = other.gameObject.GetComponent <ShieldEnemy>();

        if (shieldEnemy.isDie)
        {
            return;
        }

        if (enemyColor == _bulletColor)
        {
            if (shieldEnemy.counterShoot > 1)
            {
                shieldEnemy.GetShoot();
                shieldEnemy.shield.SetActive(false);
                shieldEnemy.speed += 0.6f;
                shieldEnemy.shieldEnemyAnimator.SetBool("SetRun", true);
            }
            else
            {
                shieldEnemy.Colored();
                if (isLast)
                {
                    shieldEnemy.gm.targetCamera.SetReturn();
                }
                other.gameObject.GetComponent <BoxCollider>().enabled = false;
            }
        }
        else
        {
            shieldEnemy.SetBlood(_bulletColor, false);
        }
    }
Ejemplo n.º 3
0
 void Start()
 {
     miAnim = GetComponent <Animator>();
     Animaciones();
     agent           = GetComponent <NavMeshAgent>();
     main            = GetComponent <ShieldEnemy>();
     player          = GameObject.FindGameObjectWithTag("Player");
     agent.isStopped = false;
 }