75 lines
1.8 KiB
C#
75 lines
1.8 KiB
C#
![]() |
// ***********************************************************************
|
|||
|
// Assembly : Game
|
|||
|
// Author : Kimch
|
|||
|
// Created : 2020-09-02
|
|||
|
// Description :
|
|||
|
// Last Modified By :
|
|||
|
// Last Modified On :
|
|||
|
// ***********************************************************************
|
|||
|
// <copyright file= "Stat_IdleAction" company="Kimch"></copyright>
|
|||
|
// <summary></summary>
|
|||
|
// ***********************************************************************
|
|||
|
using System.Collections.Generic;
|
|||
|
using UnityEngine;
|
|||
|
namespace G
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// 冲刺
|
|||
|
/// </summary>
|
|||
|
public class Stat_SprintAction : Stat_BaseAction
|
|||
|
{
|
|||
|
public Stat_SprintAction(Stat_StateManager statMgr)
|
|||
|
: base(statMgr)
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
public override bool Enter(Dictionary<string, object> param, bool clearDelegates = false)
|
|||
|
{
|
|||
|
base.Enter(param, clearDelegates);
|
|||
|
//m_curAniLength = m_char.PlayAnimation("sprint");
|
|||
|
//if (m_curAniLength == -1f)
|
|||
|
//{
|
|||
|
// return false;
|
|||
|
//}
|
|||
|
var player = m_char as EntityPlayer;
|
|||
|
Vector3 sprinting = (Vector3)param["dir"];
|
|||
|
//player.SetSprinting(sprinting);
|
|||
|
//player.OnSp(-10);
|
|||
|
m_statMgr.AddTimer(m_curAniLength, AnimationEnd_CB);
|
|||
|
return true;
|
|||
|
}
|
|||
|
|
|||
|
public override bool Exit()
|
|||
|
{
|
|||
|
m_char.SetAtkCollision(true);
|
|||
|
((EntityPlayer)m_char).ResetRigidBody();
|
|||
|
return base.Exit();
|
|||
|
}
|
|||
|
|
|||
|
public override bool CanTransition(enStat stat)
|
|||
|
{
|
|||
|
//if (MonoInstancePool.getInstance<GuideLocalData>().curGuideModule == 0)
|
|||
|
//{
|
|||
|
// return true;
|
|||
|
//}
|
|||
|
switch (stat)
|
|||
|
{
|
|||
|
case enStat.STAT_ACTION_DEAD:
|
|||
|
return true;
|
|||
|
case enStat.STAT_ACTION_SPRINT:
|
|||
|
if (m_statMgr.GetCurActionState() == enStat.STAT_ACTION_SPRINT)
|
|||
|
{
|
|||
|
return false;
|
|||
|
}
|
|||
|
break;
|
|||
|
}
|
|||
|
return true;
|
|||
|
}
|
|||
|
|
|||
|
protected virtual bool AnimationEnd_CB(object[] param)
|
|||
|
{
|
|||
|
return SetCurActionState(enStat.STAT_ACTION_MOVE);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|