BITFALL/Assets/Artists/Scripts/Player/PlayerAnimationController/PlayerMotionBasedAnimationS...

31 lines
680 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using BITFALL.Player.Movement;
using BITKit.Entities;
using BITKit.StateMachine;
using UnityEngine;
namespace BITFALL.Player.Animation.States
{
[Serializable]
public class Climb : PlayerAnimateStates
{
public override void OnStateEntry(IState old)
{
animationController.animator.Play("Climb");
}
public override void OnMovementStateChanged(IEntityMovementState oldState, IEntityMovementState newState)
{
if (newState is IPlayerClimbState or IPlayerLinkState { LinkArea: 4 })
{
animationController.TransitionState<Climb>();
}
else if(Enabled)
{
Exit();
}
}
}
}