public GameObject GenerateMob(int mobType, int mobLVL) { GetModules(mobType, mobLVL); GameObject baseObject = Instantiate(iaBase.gameObject, trsf.position, trsf.rotation) as GameObject; IABase iab = baseObject.GetComponent <IABase>(); for (int i = 0; i < iab.weaponsSlots.Length; i++) { Instantiate(iaWeapon.gameObject, iab.weaponsSlots[i].position, iab.weaponsSlots[i].rotation, iab.weaponsSlots[i]); } for (int i = 0; i < iab.eyeSlots.Length; i++) { Instantiate(iaEye.gameObject, iab.eyeSlots[i].position, iab.eyeSlots[i].rotation, iab.eyeSlots[i]); } Instantiate(iaMovement.gameObject, iab.reactorSlot.position, iab.reactorSlot.rotation, iab.reactorSlot); iab.SetUpIA(); baseObject.name = mobName + " LVL" + mobLVL; iab.level = mobLVL; return(baseObject); }
private void OnTriggerExit(Collider other) { if (other.gameObject.CompareTag("Enemy")) { IABase enemyScript = other.gameObject.GetComponent <IABase>(); enemyScript.SpeedBackToNormal(); } }
private void OnTriggerStay(Collider other) { if (other.gameObject.CompareTag("Enemy")) { IABase enemyScript = other.gameObject.GetComponent <IABase>(); enemyScript.ReduceSpeed(); } }
void GetBase(IABase[] iab, int level) { for (int i = 0; i < iab.Length; i++) { if (iab[i].data.moduleLevel == level) { iaBase = iab[i]; } } }
private void OnParticleCollision(GameObject other) { if (other.CompareTag("Enemy")) { Debug.Log("Particula Colidiu"); IABase enemyScript = other.GetComponent <IABase>(); enemyScript.CauseBurnDamage(5, 5); return; } }
private void OnParticleCollision(GameObject other) { if (other.CompareTag("Enemy")) { Debug.Log("Particula Colidiu"); IABase enemyScript = other.transform.GetComponent <IABase>(); enemyScript.TakeDamage(2); return; } //Debug.Log("particulacolidiu"); }
private void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Enemy") && attacking == false) { //Debug.Log("Detected Enemy"); detector.enabled = false; anim.SetTrigger(attackIndex); } else if (other.gameObject.CompareTag("Enemy") && attacking == true) { //Debug.Log("Enemy Hurt"); IABase enemyScript = other.gameObject.GetComponent <IABase>(); enemyScript.TakeDamage(damage); } }
public void CauseDamage(IABase inimigo) { //Inimigo enemyScript = other.transform.GetComponent<Inimigo>(); inimigo.TakeDamage(damage); //fazer o resto da trap }