private void Update()
 {
     if (Input.GetMouseButtonDown(mouseButton) && col.OverlapPoint(Camera.main.ScreenToWorldPoint(Input.mousePosition)))
     {
         ed.Dispatch(ed.CreateEventAction(eventName));
     }
 }
 private void TryDispatch()
 {
     if (Random.value < chance)
     {
         ed.Dispatch(ed.CreateEventAction(eventName));
     }
 }
Example #3
0
 public void Attack(Player p)
 {
     if (!p.PlayerDropkick.IsDropkicking)
     {
         p.Stun(stunDuration);
     }
     p.GetComponent <Rigidbody2D>().AddForce(stunForce * (p.transform.position - transform.position).normalized, ForceMode2D.Impulse);
     ed.Dispatch(ed.CreateEventAction(attackEvent));
 }