private void OnTriggerEnter(Collider other) { alive = true; if (other.gameObject.tag == "Obsticals") { Debug.Log("OOps"); alive = false; } if (other.gameObject.tag == "Enemies") { EnInfo info = other.gameObject.GetComponent <EnInfo>(); other.gameObject.GetComponent <EnInfo>().health -= (attackValue - info.defense); other.gameObject.GetComponent <EnInfo>().damaged = true; } }
private void OnTriggerEnter(Collider other) { if (BattleManager.instance.stages < 5) { if (other.gameObject.tag == "Obsticals") { accel = 0; } if (other.gameObject.tag == "Enemies") { EnInfo info = other.gameObject.GetComponent <EnInfo>(); other.gameObject.GetComponent <EnInfo>().health -= (attackValue - info.defense); other.gameObject.GetComponent <EnInfo>().damaged = true; Debug.Log("Hit"); if (info.defense > 0) { accel = 0; } } } }