NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/Gameplay/PlayerSkill/State/PlayerSkillPreNoEffect.cs

44 lines
1.2 KiB
C#

using Framework;
using Gameplay.Common;
using LTGame;
namespace Gameplay.PlayerSkill.State
{
public class PlayerSkillPreNoEffect : BasePlayerSkillState
{
public PlayerSkillPreNoEffect(PlayerSkillManager owner) : base(owner, EPlayerSkillState.PreNoEffect)
{
}
protected override void _OnEnter(NBaseState exitState,
object param)
{
base._OnEnter(exitState, param);
EventManager.Instance.Register<EDReleasePlayerSkill>(EventManager.EventName.INFIGHT_PLAYER_SKILL_RELEASE, _OnRecvRelease);
}
protected override void _OnExit(NBaseState exitState,
object param)
{
base._OnExit(exitState, param);
EventManager.Instance.Unregister<EDReleasePlayerSkill>(EventManager.EventName.INFIGHT_PLAYER_SKILL_RELEASE, _OnRecvRelease);
}
private void _OnRecvRelease(EDReleasePlayerSkill releaseData)
{
isFinished = true;
if (releaseData.isCancel)
{
nextState = EPlayerSkillState.Idle;
return;
}
nextState = EPlayerSkillState.Release;
}
}
}