Exemple #1
0
 private void Awake()
 {
     movimiento    = GetComponentInChildren <PlayerMovement>();
     playerDisparo = GetComponentInChildren <Disparar>();
     rbPlayer      = GetComponent <Rigidbody2D>();
     playerSprite  = GetComponent <SpriteRenderer>();
 }
Exemple #2
0
 void Awake()
 {
     _rigidbody = GetComponent <Rigidbody2D>();
     _animator  = GetComponent <Animator>();
     _disparar  = GetComponentInChildren <Disparar>();
     _audio     = GetComponentInChildren <AudioSource>();
 }
Exemple #3
0
 private void Start()
 {
     minutos = 0;
     player  = GameObject.FindGameObjectWithTag("Player");
     sPlayer = player.GetComponent <StatsPlayer>();
     disp    = player.GetComponent <Disparar>();
 }
Exemple #4
0
 void Start()
 {
     if (gameObject.tag.Contains("Enemy"))
     {
         enemiestag = "Ally";
     }
     else
     {
         enemiestag = "Enemy";
     }
     torreta        = this.GetComponent <Disparar>();
     torreta.origen = transform.position;
 }
Exemple #5
0
    // Update is called once per frame
    void Update()
    {
        if (target)
        {
            if (CanSeeTarget(seeDistance, target.transform.position))
            {
                //if target sirve para saber si el objeto sta o no destruido

                this.transform.rotation = AimRotation(this.transform, target.transform.position, rotationSpeed);
            }



            if (CanSeeTarget(fireDistance, target.transform.position))
            {
                Disparar disparo = GetComponent <Disparar> ();
                if (disparo)
                {
                    if (indice < arrayMisil.Length)
                    {
                        if (lastShoolTime + coolDown <= Time.time)
                        {
                            lastShoolTime = Time.time;

                            Debug.Log("numero array" + indice);
                            disparo.Fire(arrayMisil [indice]);
                            indice++;
                        }
                    }
                    else
                    {
                        indice = 0;
                    }
                }
            }
        }
        else
        {
            target = GameObject.FindGameObjectWithTag("Player");
        }
    }
    private void Start()
    {
        //componentes player
        disparoPlayer    = GetComponent <Disparar>();
        movimientoPlayer = GetComponentInChildren <PlayerMovement>();
        knockback        = GetComponentInChildren <Knockback>();
        rb         = GetComponent <Rigidbody2D>();
        vidasExtra = 0;

        //componentes de enemigos
        dispara = GetComponentInChildren <DisparoEnemigo>();
        moverse = GetComponentInChildren <EnemigoToPlayer>();

        //animacion
        if (gameObject.GetComponentInChildren <FlipMimico>() != null)
        {
            anim = transform.GetComponentInChildren <Animator>();
        }
        else
        {
            anim = transform.GetComponent <Animator>();
        }
    }
 void Start()
 {
     disparar = new Disparar(Prefab_Bala, Empty_Alessio, Tipo_Arma);
 }
Exemple #8
0
    void Start()
    {
        pistolaEnemigo = new Pistola();

        disparoEnemigo = new Disparar(Prefab_Bala, Empty_Rufianes, pistolaEnemigo.getPistola());
    }
 private void Awake()
 {
     rb            = GetComponentInParent <Rigidbody2D>();
     disparoPlayer = GetComponentInParent <Disparar>();
     PlayerMove    = GetComponent <PlayerMovement>();
 }