player walk animation
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class Character : MonoBehaviour
|
||||
public abstract class Character : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
protected Animator _animator;
|
||||
@@ -65,7 +65,7 @@ public class Character : MonoBehaviour
|
||||
FlipCharacter();
|
||||
}
|
||||
|
||||
//animator.SetBool("Walk", h_movement != 0);
|
||||
SetWalkingAnimation(h_movement != 0);
|
||||
|
||||
_isOnLadder = mapElement == MapElementType.Ladder || GetMapElement(Vector2.up) == MapElementType.Ladder;
|
||||
if (_isOnLadder)
|
||||
@@ -105,6 +105,7 @@ public class Character : MonoBehaviour
|
||||
return MapElementType.Empty;
|
||||
}
|
||||
|
||||
protected abstract void SetWalkingAnimation(bool isWalking);
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
@@ -119,7 +120,7 @@ public class Character : MonoBehaviour
|
||||
if (_isFalling)
|
||||
{
|
||||
_body.velocity = new Vector2(0, _body.velocity.y);
|
||||
//animator.SetBool("Walk", false);
|
||||
SetWalkingAnimation(false);
|
||||
|
||||
if (GetMapElement(Vector2.down)==MapElementType.Ladder)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user