Advertisement
Guest User

Untitled

a guest
Dec 19th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.01 KB | None | 0 0
  1.     void Update () {
  2.         if (Input.GetButtonDown ("Attack") && playerStatus.CanAttack ()) {
  3.             if (currentState == PlayerStatus.State.Jump) {
  4.                 //jump attack goes here
  5.             } else {
  6.                 if (currentState == PlayerStatus.State.Attack && playerStatus.attackAnimEnded == false) {
  7.                    
  8.                     //Debug.Log ("Queue set to " + Mathf.Min (3, Mathf.Max(highestQueuedCombo + 1, comboCount + 1)) + " and the last hit was " + comboCount);
  9.                     highestQueuedCombo = Mathf.Min (3, Mathf.Max(highestQueuedCombo + 1, comboCount + 1));
  10.                     if (highestQueuedCombo == 1) {
  11.                         highestQueuedCombo = 0;
  12.                     }
  13.                 } else {
  14.                     if (comboCount > 0 && Time.time > comboWindowEnd) {
  15.                         //Debug.Log ("Combo window expired");
  16.                         comboCount = 0;
  17.                         highestQueuedCombo = 0;
  18.                     }
  19.                     comboCount++;
  20.                     //Debug.Log ("Executing standard free attack at combo count " + comboCount);
  21.                     playerStatus.Attack (comboCount);
  22.                     if (comboCount == 3) {
  23.                         comboCount = 0;
  24.                         highestQueuedCombo = 0;
  25.                     }
  26.                 }
  27.             }
  28.         }
  29.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement