void aplicarItem(ControlEnemy personagem) { if (personagem.HP + cura > personagem.HPMax) { personagem.HP = personagem.HPMax; } else { personagem.HP += cura; } gameObject.SetActive(false); }
void Start() { anim = GetComponent <Animator>(); enemy = GetComponent <ControlEnemy>(); enemy.HP = HP; enemy.HPMax = HP; enemy.ATK = ATK; enemy.DEF = DEF; enemy.VEL = VEL; enemy.raioTorre = raioAtaqueTorre; enemy.raioAtaque = raioAtaqueInimigo; enemy.velocidadeMov = 0.0005f * VEL; enemy.velocidadeAtk = 2500 / VEL; }
private void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Player")) { ControlPlayer player = other.transform.GetComponent <ControlPlayer>(); aplicarItem(player); Destroy(gameObject); } if (other.gameObject.CompareTag("Inimigo")) { ControlEnemy inimigo = other.transform.GetComponent <ControlEnemy>(); aplicarItem(inimigo); Destroy(gameObject); } }
private void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Player")) { player = other.transform.GetComponent <ControlPlayer>(); aplicarItem(player); ParticleSystem [] part = other.gameObject.GetComponentsInChildren <ParticleSystem>(); part[1].Play(); Destroy(gameObject, 15.0f); } if (other.gameObject.CompareTag("Inimigo")) { inimigo = other.transform.GetComponent <ControlEnemy>(); aplicarItem(inimigo); ParticleSystem[] part = other.gameObject.GetComponentsInChildren <ParticleSystem>(); part[1].Play(); Destroy(gameObject, 15.0f); } }
void desfazerItem(ControlEnemy personagem) { personagem.ATK -= atk; gameObject.SetActive(false); }
void aplicarItem(ControlEnemy personagem) { personagem.ATK += atk; gameObject.SetActive(false); }
void aplicarItem(ControlEnemy personagem) { }
void desfazerItem(ControlEnemy personagem) { personagem.DEFBonus += def; gameObject.SetActive(false); }
void aplicarItem(ControlEnemy personagem) { personagem.DEFBonus -= def; gameObject.SetActive(false); }