2023-08-27 02:58:19 +08:00
|
|
|
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)
|
|
|
|
{
|
2023-10-20 19:31:12 +08:00
|
|
|
if (newState is IPlayerClimbState or IPlayerLinkState { LinkArea: 4 })
|
2023-08-27 02:58:19 +08:00
|
|
|
{
|
|
|
|
animationController.TransitionState<Climb>();
|
|
|
|
}
|
|
|
|
else if(Enabled)
|
|
|
|
{
|
2023-11-30 00:23:23 +08:00
|
|
|
Exit();
|
2023-08-27 02:58:19 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|