Update global input actions and rework player joining

This commit is contained in:
RochesterX
2025-01-17 10:57:29 -05:00
parent 4623583ffd
commit 79e3d3f301
8 changed files with 38 additions and 1265 deletions

View File

@@ -0,0 +1,31 @@
using UnityEngine;
[RequireComponent(typeof(Animator))]
public class AnimationPlayer : MonoBehaviour
{
public enum AnimationState { Idle, Run, Jump };
public AnimationState state;
public bool backwards;
public AnimationClip clip;
private Animator animator;
private void Start()
{
animator = GetComponent<Animator>();
animator.Play(clip.name);
}
private void LateUpdate()
{
animator.SetInteger("state", (int)state);
transform.localScale = new Vector3(Mathf.Sign(backwards ? -1 : 1) * Mathf.Abs(transform.localScale.x), transform.localScale.y, transform.localScale.z);
}
public void SetState(AnimationState state)
{
this.state = state;
}
}