Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Update () {
- if (Input.GetButtonDown ("Attack") && playerStatus.CanAttack ()) {
- if (currentState == PlayerStatus.State.Jump) {
- //jump attack goes here
- } else {
- if (currentState == PlayerStatus.State.Attack && playerStatus.attackAnimEnded == false) {
- //Debug.Log ("Queue set to " + Mathf.Min (3, Mathf.Max(highestQueuedCombo + 1, comboCount + 1)) + " and the last hit was " + comboCount);
- highestQueuedCombo = Mathf.Min (3, Mathf.Max(highestQueuedCombo + 1, comboCount + 1));
- if (highestQueuedCombo == 1) {
- highestQueuedCombo = 0;
- }
- } else {
- if (comboCount > 0 && Time.time > comboWindowEnd) {
- //Debug.Log ("Combo window expired");
- comboCount = 0;
- highestQueuedCombo = 0;
- }
- comboCount++;
- //Debug.Log ("Executing standard free attack at combo count " + comboCount);
- playerStatus.Attack (comboCount);
- if (comboCount == 3) {
- comboCount = 0;
- highestQueuedCombo = 0;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement