//Inicializacion de componentes void Start() { tipo = GetComponent <TipoEnemigo>(); enemyMovement = GetComponent <EnemyMovement>(); enemyMovement.CambiarDireccion(puntos[i % puntos.Length]); Physics2D.queriesStartInColliders = false; }
void OnTriggerEnter2D(Collider2D other) { TipoEnemigo enemy = other.gameObject.GetComponent <TipoEnemigo>(); if (enemy && enemy.TipoDeEnemigo() == Disfraz.guardia) { Destroy(this.gameObject, tiempoVida); } }
public void CambiarTipoEnemigo(TipoEnemigo tipo) { if (transform.childCount != 0) { if (transform.GetChild(0).GetComponent <NPC>() != null) { transform.GetChild(0).GetComponent <NPC>().tipoEnemigo = tipo; } } }
private void addWolfy(object sender, EventArgs e) { this.currentStatus = AppState.AddingEnemy; tipoEnemigo = TipoEnemigo.Wolfy; this.flechaToolStripButton.Checked = false; this.vampyToolStripButton.Checked = false; //this.fantyToolStripButton.Checked = false; this.frankyToolStripButton.Checked = false; this.coinToolStripButton.Checked = false; uncheckPlatforms(); }
public IEnemigo CrearEnemigo(TipoEnemigo tipo) { switch (tipo) { case TipoEnemigo.Mago: return(new Mago()); case TipoEnemigo.Ninja: return(new Ninja()); case TipoEnemigo.Samurai: return(new Samurai()); default: throw new ArgumentOutOfRangeException(); } }
private void Start() { movEnemigo = GetComponentInParent <MovimientoEnemigo>(); tipoEnemigo = GetComponentInParent <TipoEnemigo>(); }
private void Start() { TipoEnemigo = enemyGO.GetComponent <TipoEnemigo>(); enemyMov = gameObject.GetComponentInParent <MoveEnemy>(); render = GetComponent <SpriteRenderer>(); }
private void addWolfy(object sender, EventArgs e) { this.currentStatus = AppState.AddingEnemy; tipoEnemigo = TipoEnemigo.Wolfy; this.flechaToolStripButton.Checked = false; this.vampyToolStripButton.Checked = false; //this.fantyToolStripButton.Checked = false; this.frankyToolStripButton.Checked = false; this.coinToolStripButton.Checked = false; uncheckPlatforms(); }