예제 #1
0
 void Start()
 {
     vida      = GetComponent <VidaEnemyBase>();
     stMachine = GetComponent <StateMachine>();
     col       = GetComponent <Collider>();
     agente    = transform.GetComponent <UnityEngine.AI.NavMeshAgent>();
 }
예제 #2
0
 // Start is called before the first frame update
 void Start()
 {
     playerRef       = FindObjectOfType <Mov>();
     refStateManager = GetComponent <StateMachine>();
     col             = GetComponent <Collider>();
     vidaEnemy       = GetComponent <VidaEnemyBase>();
 }
예제 #3
0
 // Start is called before the first frame update
 void Start()
 {
     playerRef       = FindObjectOfType <Mov>();
     miAnim          = GetComponent <Animator>();
     refStateManager = GetComponent <StateMachine>();
     vida            = GetComponent <VidaEnemyBase>();
     newScale(rangeObj, distance2Apuntar);
 }
예제 #4
0
 void Start()
 {
     vida        = GetComponent <VidaEnemyBase>();
     agent       = GetComponent <NavMeshAgent>();
     speedMax    = agent.speed;
     speedHitted = 0;
     anim        = GetComponent <Animator>();
 }
예제 #5
0
    protected override void AplicarEfecto(Collider coll)
    {
        VidaEnemyBase enemyColisionado = coll.GetComponent <VidaEnemyBase>();

        if (enemyColisionado != null)
        {
            enemyColisionado.TakeDamage(damageBala);
        }
    }
예제 #6
0
 void Start()
 {
     miAnim = GetComponent <Animator>();
     Animaciones();
     vida              = GetComponent <VidaEnemyBase>();
     kamiNav           = GetComponent <NavMeshAgent>();
     player            = GameObject.FindGameObjectWithTag("Player");
     kamiBehaviour     = GetComponent <Kamikaze>();
     kamiNav.isStopped = false;
 }
예제 #7
0
 // Start is called before the first frame update
 void Start()
 {
     playerRef       = FindObjectOfType <DashCast>();
     refStateManager = GetComponent <StateMachine>();
     vidaEnemy       = GetComponent <VidaEnemyBase>();
     posInicial      = transform.position;
     col             = GetComponent <Collider>();
     agente          = transform.GetComponent <UnityEngine.AI.NavMeshAgent>();
     miAnim          = GetComponent <Animator>();
 }
예제 #8
0
 void Start()
 {
     start           = transform.position;
     col             = GetComponent <Collider>();
     vida            = GetComponent <VidaEnemyBase>();
     Player          = GameObject.FindGameObjectWithTag("Player");
     kami            = GetComponent <NavMeshAgent>();
     Anim            = GetComponent <Animator>();
     cmpAudioSource  = GetComponentInParent <AudioSource>();
     refStateManager = GetComponent <StateMachine>();
 }
예제 #9
0
 void Start()
 {
     miAnim            = GetComponent <Animator>();
     vida              = GetComponent <VidaEnemyBase>();
     kamiNav           = GetComponent <NavMeshAgent>();
     start             = transform.position;
     kamiNav.isStopped = false;
     kamiNav.SetDestination(vida.lookForPlayer);
     vida.hitted     = false;
     refStateManager = GetComponent <StateMachine>();
     Animaciones();
 }
예제 #10
0
    protected virtual void AplicarEfecto(Collider coll) // EN APLICAR EFECTO. BUSCA LA VIDA DEL PLAYER Y LE PASAS EL METODO TAKEDAMAGE(damageBala) ESTA VARIABLE LA TIENE
    {                                                   //EL SCRIPT
        VidaEnemyBase enemyColisionado = coll.GetComponent <VidaEnemyBase>();

        if (enemyColisionado != null)
        {
            if (chocaEnemigo.Length != 0)
            {
                NuevoSonido(chocaEnemigo[Random.Range(0, chocaEnemigo.Length - 1)], this.transform.position, 5f);
            }
            // SoundVFX(chocaEnemigo);
            enemyColisionado.TakeDamage(damageBala);
        }

        /* EnemyVida enemyColisionado = collision.GetComponent<EnemyVida>();   Comprobar que sea enemigo y enviarle el daño que hace el tipo de bullet
         * if (enemyColisionado != null)
         * {
         *     enemyColisionado.TakeDamage(damageBala);
         * }
         */
    }