shaoxiadiablo/Assets/AGame/Scripts/Game/Stat/Stat_ReviveAction.cs

71 lines
1.6 KiB
C#
Raw Normal View History

2025-05-18 01:04:31 +08:00
// ***********************************************************************
// 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_ReviveAction : Stat_BaseAction
{
private bool end;
public Stat_ReviveAction(Stat_StateManager statMgr)
: base(statMgr)
{
}
public override bool Enter(Dictionary<string, object> param, bool clearDelegates = false)
{
base.Enter(param, clearDelegates);
m_char.StopAnimation();
Vector3 curPos = (Vector3)param["pos"];
m_char.position = (curPos);
string aniName = (string)param["aniName"];
//m_curAniLength = m_char.PlayAnimation(aniName);
if (m_curAniLength == -1f)
{
return false;
}
m_statMgr.AddTimer(m_curAniLength, AnimationEnd_CB);
m_char.SetColliderEnabled(true);
end = false;
return true;
}
public override bool CanTransition(enStat stat)
{
if (stat == enStat.STAT_ACTION_DEAD)
{
return true;
}
//if (MonoInstancePool.getInstance<GuideLocalData>().curGuideModule == 0)
//{
// return true;
//}
if (!end)
{
return false;
}
return true;
}
protected virtual bool AnimationEnd_CB(object[] param)
{
end = true;
return SetCurActionState(enStat.STAT_ACTION_IDLE);
}
}
}