//Handles failure state public void ReceiveEvent(CustomEvent evt) { if(evt.GetEventName() == "Time Up") { //game over gameOver = 1; StartCoroutine(pause()); } }
public void RecieveEvent(CustomEvent evt) { if(evt.GetEventName() == "Sword Attack") { int evtX, evtY, x, y; evtX = evt.GetParam(0); evtY = evt.GetParam(1); x = (int)transform.position.x; y = (int)transform.position.y; float distance = Vector3.Distance(transform.position, new Vector3(evtX, evtY, 0.0f)); if(distance < 120.0f) { this.takeDamage(1, evt.GetParam(2)); } } }
void RecieveEvent(CustomEvent evt) { if(evt.GetEventName() == "Sword Attack") { int evtX, evtY; evtX = evt.GetParam(0); evtY = evt.GetParam(1); float distance = Vector3.Distance(transform.position, new Vector3(evtX, evtY, 0.0f)); if(distance < 40.0f) { this.takeDamage((int)ATTACK_TYPE.MELEE, evt.GetParam(2)); } } }