Climbing Animation
This commit is contained in:
@@ -6,9 +6,16 @@ public abstract class Character : MonoBehaviour
|
||||
protected Animator _animator;
|
||||
[SerializeField]
|
||||
private float MovementSpeed = 1.5f;
|
||||
[SerializeField]
|
||||
private GameObject _vikingSide;
|
||||
[SerializeField]
|
||||
private GameObject _vikingBack;
|
||||
|
||||
[SerializeField]
|
||||
private LayerMask _mapLayer;
|
||||
|
||||
|
||||
|
||||
private Rigidbody2D _body;
|
||||
private BoxCollider2D _boxCollider;
|
||||
|
||||
@@ -73,7 +80,6 @@ public abstract class Character : MonoBehaviour
|
||||
isAllowVertical = true;
|
||||
_isOnLadder = true;
|
||||
v_movement = inputVertical;
|
||||
|
||||
if (v_movement > 0)
|
||||
{
|
||||
if (GetMapElement(Vector2.up) != MapElementType.Ladder)
|
||||
@@ -81,6 +87,7 @@ public abstract class Character : MonoBehaviour
|
||||
v_movement = 0;
|
||||
}
|
||||
}
|
||||
SetClimbingAnimation(v_movement != 0);
|
||||
}
|
||||
_body.velocity = new Vector2(h_movement * MovementSpeed, v_movement * MovementSpeed);
|
||||
}
|
||||
@@ -105,6 +112,7 @@ public abstract class Character : MonoBehaviour
|
||||
}
|
||||
|
||||
protected abstract void SetWalkingAnimation(bool isWalking);
|
||||
protected abstract void SetClimbingAnimation(bool isClimbing);
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user