private void Awake() { movimiento = GetComponentInChildren <PlayerMovement>(); playerDisparo = GetComponentInChildren <Disparar>(); rbPlayer = GetComponent <Rigidbody2D>(); playerSprite = GetComponent <SpriteRenderer>(); }
void Awake() { _rigidbody = GetComponent <Rigidbody2D>(); _animator = GetComponent <Animator>(); _disparar = GetComponentInChildren <Disparar>(); _audio = GetComponentInChildren <AudioSource>(); }
private void Start() { minutos = 0; player = GameObject.FindGameObjectWithTag("Player"); sPlayer = player.GetComponent <StatsPlayer>(); disp = player.GetComponent <Disparar>(); }
void Start() { if (gameObject.tag.Contains("Enemy")) { enemiestag = "Ally"; } else { enemiestag = "Enemy"; } torreta = this.GetComponent <Disparar>(); torreta.origen = transform.position; }
// 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); }
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>(); }