133 lines
3.1 KiB
C#
133 lines
3.1 KiB
C#
// ***********************************************************************
|
||
// Assembly : Game
|
||
// Author : Kimch
|
||
// Created : 2020-09-02
|
||
// Description :
|
||
// Last Modified By :
|
||
// Last Modified On :
|
||
// ***********************************************************************
|
||
// <copyright file= "Snake_base" company="Kimch"></copyright>
|
||
// <summary></summary>
|
||
// ***********************************************************************
|
||
using System.Collections.Generic;
|
||
using UnityEngine;
|
||
|
||
namespace G
|
||
{
|
||
/// <summary>
|
||
///
|
||
/// </summary>
|
||
public class Stat_DeadAction : Stat_BaseAction
|
||
{
|
||
#pragma warning disable CS0649 // 从未对字段“Stat_DeadAction.m_time”赋值,字段将一直保持其默认值 0
|
||
private float m_time;
|
||
#pragma warning restore CS0649 // 从未对字段“Stat_DeadAction.m_time”赋值,字段将一直保持其默认值 0
|
||
|
||
public Stat_DeadAction(Stat_StateManager statMgr)
|
||
: base(statMgr)
|
||
{
|
||
}
|
||
|
||
public override bool Enter(Dictionary<string, object> param, bool clearDelegates = false)
|
||
{
|
||
RecordTaskData();
|
||
StatisticRecord();
|
||
base.Enter(param, clearDelegates);
|
||
//m_char.ReleaseDataOnDead();
|
||
//string animName = m_char.GetAnimName("dead");
|
||
//m_time = m_char.PlayAnimationByName(animName, true);
|
||
if (m_time == -1f)
|
||
{
|
||
return false;
|
||
}
|
||
SetTimers();
|
||
return true;
|
||
}
|
||
|
||
public override bool CanTransition(enStat stat)
|
||
{
|
||
if (stat == enStat.STAT_ACTION_REVIVE)
|
||
{
|
||
return true;
|
||
}
|
||
return false;
|
||
}
|
||
|
||
private void SetTimers()
|
||
{
|
||
m_statMgr.AddTimer(m_time, TimeEnd_CB);
|
||
}
|
||
|
||
private bool TimeEnd_CB(object[] param)
|
||
{
|
||
m_statMgr.ClearTimer();
|
||
return false;
|
||
}
|
||
|
||
private void RecordTaskData()
|
||
{
|
||
//if (m_char.IsMonster())
|
||
//{
|
||
// if (m_char.myAtker != null)
|
||
// {
|
||
// if (m_char.myAtker.IsPlayer())
|
||
// {
|
||
// DailyTaskDataManager.instance.killOnceCount++;
|
||
// }
|
||
// DailyTaskDataManager.instance.DoDailyTask(4, 1);
|
||
// }
|
||
//}
|
||
//else if (m_char.IsBoss() && m_char.IsNeedDeadCount())
|
||
//{
|
||
// if (LevelData.levelType == LevelType.Endless)
|
||
// {
|
||
// DailyTaskDataManager.instance.DoDailyTask(7, 1);
|
||
// }
|
||
// else
|
||
// {
|
||
// DailyTaskDataManager.instance.DoDailyTask(8, 1);
|
||
// }
|
||
//}
|
||
}
|
||
|
||
private void StatisticRecord()
|
||
{
|
||
//DataStatistics instance = DataStatistics.instance;
|
||
if (m_char.IsMinion())
|
||
{
|
||
//if (m_char.myAtker != null)
|
||
//{
|
||
// instance.AddRecord("kill", 1);
|
||
//}
|
||
}
|
||
else
|
||
{
|
||
//if (!m_char.IsBoss() || !m_char.IsNeedDeadCount())
|
||
//{
|
||
// return;
|
||
//}
|
||
//if (LevelData.levelType == LevelType.Endless)
|
||
//{
|
||
// instance.AddRecord("endlessBoss", 1);
|
||
//}
|
||
//else
|
||
//{
|
||
// instance.AddRecord("killBoss", 1);
|
||
//}
|
||
//if (MonoInstancePool.getInstance<GuideLocalData>().curGuideModule != 0)
|
||
//{
|
||
// return;
|
||
//}
|
||
//GuideManager guideManager = (GuideManager)Object.FindObjectOfType(typeof(GuideManager));
|
||
//if (guideManager != null)
|
||
//{
|
||
// GuiModuleBase curEvent = guideManager.getCurEvent();
|
||
// if (curEvent == null)
|
||
// {
|
||
// }
|
||
//}
|
||
}
|
||
}
|
||
}
|
||
}
|