mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-28 05:14:04 -05:00
Fine tuned animations
This commit is contained in:
@@ -5,12 +5,24 @@ using UnityEngine;
|
||||
public class AerialJumpingState : AerialBaseState
|
||||
{
|
||||
|
||||
private int previousJumpNum;
|
||||
public override void EnterState(AerialStateManager aSM, AerialBaseState previousState){
|
||||
|
||||
//if odd, do left jump
|
||||
previousJumpNum = aSM.curJumpNum;
|
||||
if (aSM.curJumpNum % 2 == 1)
|
||||
{
|
||||
aSM.GetComponent<Animator>().SetBool("isJumpingLeft", true);
|
||||
}
|
||||
//if even, do right jump
|
||||
else if(aSM.curJumpNum % 2 == 0)
|
||||
{
|
||||
aSM.GetComponent<Animator>().SetBool("isJumpingRight", true);
|
||||
}
|
||||
}
|
||||
|
||||
public override void ExitState(AerialStateManager aSM, AerialBaseState nextState){
|
||||
|
||||
aSM.GetComponent<Animator>().SetBool("isJumpingLeft", false);
|
||||
aSM.GetComponent<Animator>().SetBool("isJumpingRight", false);
|
||||
}
|
||||
|
||||
public override void UpdateState(AerialStateManager aSM){
|
||||
@@ -44,6 +56,23 @@ public class AerialJumpingState : AerialBaseState
|
||||
//if grapple release then apply grapple release force
|
||||
if(aSM.pStats.HasGrapple){
|
||||
aSM.GrappleReleaseForce();
|
||||
}
|
||||
}
|
||||
if (aSM.curJumpNum != previousJumpNum)
|
||||
{
|
||||
previousJumpNum = aSM.curJumpNum;
|
||||
aSM.GetComponent<Animator>().SetBool("isJumpingLeft", false);
|
||||
aSM.GetComponent<Animator>().SetBool("isJumpingRight", false);
|
||||
|
||||
if (aSM.curJumpNum % 2 == 1)
|
||||
{
|
||||
aSM.GetComponent<Animator>().SetBool("isJumpingLeft", true);
|
||||
}
|
||||
//if even, do right jump
|
||||
else if (aSM.curJumpNum % 2 == 0)
|
||||
{
|
||||
aSM.GetComponent<Animator>().SetBool("isJumpingRight", true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user