using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Rigging.Data { [DisallowMultipleComponent] public class SetAnimationByInput : RiggingDataBase { private Rigging.Inputs.InputHandler input; private AnimationHandler anim; private StandingDataHandler standingData; protected override void OnStart() { input = player.input; anim = player.status.animation; standingData = player.status.standingData; } private void Update() { if ((double)standingData.sinceGrounded > 0.2) { //anim.animationState = 3; // jump } else if (input.inputMovementDirection.magnitude > 0.1f) { if (input.isSpringting) { anim.animationState = 2; // sprint } else { anim.animationState = 1; // run } } else { anim.animationState = 0; // stand } } } }