Example #1
0
 private void Jump(float power)
 {
     EntityJumpedInfo.JumpEvent result = info.GetEventSystem <EntityJumpedInfo.JumpEvent>().CallListners(new EntityJumpedInfo.JumpEvent(gameObject, power));
     if (!result.IsCancel)
     {
         rigidbody2D.AddForce(new Vector2(0, result.JumpPower));
     }
 }
Example #2
0
    private void Attack()
    {
        AttackEvent result = info.GetEventSystem <AttackEvent>().CallListners(new AttackEvent(gameObject));

        if (result.IsCancel)
        {
            return;
        }

        isAttack     = true;
        currentCombo = (currentCombo + 1) >= numberOfCombo ? 0 : currentCombo + 1;
        if (postAttackTimer != null)
        {
            postAttackTimer.Remove();
            postAttackTimer = null;
        }
    }