Part9:Wall Slide State(P36)
1:效果和操作
效果:碰到墙体减速下滑
操作:给墙体添加材质,使其摩擦系数改小,防止人物卡在墙体上,定义WallSlide参数和PlayerWallSlide动画
实现:当人物处于airstate时,若人物与墙体IsWallDetected为true,则转化为slide状态
2:代码改变
//新增PlayerWallSlideState
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerWallSlideState : PlayerState//墙体下滑状态
{
public PlayerWallSlideState(Player _player, PlayerStateMachine _stateMachine, string _animBoolName) : base(_player, _stateMachine, _animBoolName)
{
}
public override void Enter()
{
base.Enter(