142 lines
3.9 KiB
C#
142 lines
3.9 KiB
C#
![]() |
using System.Collections.Generic;
|
|||
|
using UnityEngine;
|
|||
|
namespace G
|
|||
|
{
|
|||
|
|
|||
|
public class Stat_SuperSprintAction : Stat_BaseAction
|
|||
|
{
|
|||
|
private Transform ef_linehit;
|
|||
|
|
|||
|
private Transform ef_swordExteme;
|
|||
|
|
|||
|
#pragma warning disable CS0649 // 从未对字段“Stat_SuperSprintAction.m_end”赋值,字段将一直保持其默认值 false
|
|||
|
private bool m_end;
|
|||
|
#pragma warning restore CS0649 // 从未对字段“Stat_SuperSprintAction.m_end”赋值,字段将一直保持其默认值 false
|
|||
|
|
|||
|
private bool m_onlyOne;
|
|||
|
|
|||
|
public Stat_SuperSprintAction(Stat_StateManager statMgr)
|
|||
|
: base(statMgr)
|
|||
|
{
|
|||
|
ef_linehit = PrefabManager.Instance().Spawn("ef_linehit");
|
|||
|
ef_linehit.gameObject.SetActive(false);
|
|||
|
ef_swordExteme = PrefabManager.Instance().Spawn("sword_extreme");
|
|||
|
ef_swordExteme.gameObject.SetActive(false);
|
|||
|
ef_swordExteme.GetComponent<Ef_base>().m_skillId = 400106;
|
|||
|
}
|
|||
|
|
|||
|
public override bool Enter(Dictionary<string, object> param, bool clearDelegates = false)
|
|||
|
{
|
|||
|
//UIBattleCFZ.Play();
|
|||
|
//RecordTaskData();
|
|||
|
//ComboCtrl.instance.Reset();
|
|||
|
//m_char.IsSkilling = true;
|
|||
|
//m_char.SetAtkCollision(false);
|
|||
|
//m_onlyOne = false;
|
|||
|
//m_end = false;
|
|||
|
//base.Enter(param, clearDelegates);
|
|||
|
//m_char.m_animation.Stop();
|
|||
|
//m_char.m_animation.Play("skill52_01");
|
|||
|
//m_char.m_animation.PlayQueued("skill52_02");
|
|||
|
//m_char.GetComponent<Rigidbody>().mass = 6f;
|
|||
|
//m_char.GetComponent<Rigidbody>().drag = 15f;
|
|||
|
//GameCtrl.SetTimeScale(0.1f);
|
|||
|
//var myPlayer = m_char as EntityMainPlayer;
|
|||
|
//Vector3 superSprinting = (Vector3)param["dir"];
|
|||
|
//myPlayer.SetSuperSprinting(superSprinting);
|
|||
|
//myPlayer.SuperMode = false;
|
|||
|
//myPlayer.SuperModeEnd();
|
|||
|
//ef_swordExteme.GetComponent<Sword_Extreme>().SetStartPos(m_char.GetCurPos() + Vector3.up * 0.1f);
|
|||
|
//ef_swordExteme.gameObject.SetActive(true);
|
|||
|
//HeroSounds.Instance.SkillWhoopSound(myPlayer);
|
|||
|
//myPlayer.UpdateAttackSpeed();
|
|||
|
//myPlayer.SetColliderEnabled(false);
|
|||
|
return true;
|
|||
|
}
|
|||
|
|
|||
|
public override bool UpdateDelegate()
|
|||
|
{
|
|||
|
//if (m_char.m_animation.IsPlaying("skill52_01"))
|
|||
|
//{
|
|||
|
// m_char.AddCurPos(m_char.GetCurDir() * 0.03f * Time.deltaTime);
|
|||
|
// if (m_char.GetCurDir() != Vector3.zero)
|
|||
|
// {
|
|||
|
// m_char.transform.forward = m_char.GetCurDir();
|
|||
|
// }
|
|||
|
//}
|
|||
|
//else if (m_char.m_animation.IsPlaying("skill52_02"))
|
|||
|
//{
|
|||
|
// if (m_onlyOne)
|
|||
|
// {
|
|||
|
// return true;
|
|||
|
// }
|
|||
|
// ef_linehit.position = m_char.GetCurPos() + Vector3.up * 0.02f;
|
|||
|
// ef_linehit.right = -m_char.transform.forward;
|
|||
|
// ef_linehit.gameObject.SetActive(true);
|
|||
|
// GameCtrl.RecoverTimeScale();
|
|||
|
// m_char.transform.GetComponent<Rigidbody>().AddForce(m_char.transform.forward * 6000f);
|
|||
|
// m_onlyOne = true;
|
|||
|
//}
|
|||
|
//else if (m_onlyOne)
|
|||
|
//{
|
|||
|
// m_end = true;
|
|||
|
// Exit();
|
|||
|
// if (m_char.normalAtkEnableMove)
|
|||
|
// {
|
|||
|
// SetCurActionState(enStat.STAT_ACTION_MOVE);
|
|||
|
// }
|
|||
|
// else
|
|||
|
// {
|
|||
|
// SetCurActionState(enStat.STAT_ACTION_IDLE);
|
|||
|
// }
|
|||
|
//}
|
|||
|
return true;
|
|||
|
}
|
|||
|
|
|||
|
public override bool Exit()
|
|||
|
{
|
|||
|
if (m_char.IsPlayer())
|
|||
|
{
|
|||
|
//DailyTaskDataManager.instance.RecordKillOnce();
|
|||
|
}
|
|||
|
m_char.SetColliderEnabled(true);
|
|||
|
m_char.isSkilling = false;
|
|||
|
m_char.SetAtkCollision(true);
|
|||
|
((EntityPlayer)m_char).ResetRigidBody();
|
|||
|
//if (MonoInstancePool.getInstance<GuideLocalData>().curGuideModule == 1)
|
|||
|
//{
|
|||
|
// GuideManager._instance.getCurEvent()?.next();
|
|||
|
//}
|
|||
|
return base.Exit();
|
|||
|
}
|
|||
|
|
|||
|
public override bool CanTransition(enStat stat)
|
|||
|
{
|
|||
|
if (stat == enStat.STAT_ACTION_DEAD)
|
|||
|
{
|
|||
|
//GameCtrl.RecoverTimeScale();
|
|||
|
return true;
|
|||
|
}
|
|||
|
if (m_char.isSkilling)
|
|||
|
{
|
|||
|
return false;
|
|||
|
}
|
|||
|
if (!m_end)
|
|||
|
{
|
|||
|
return false;
|
|||
|
}
|
|||
|
return true;
|
|||
|
}
|
|||
|
|
|||
|
private void RecordTaskData()
|
|||
|
{
|
|||
|
if (m_char.IsPlayer())
|
|||
|
{
|
|||
|
//DailyTaskDataManager.instance.killOnceCount = 0;
|
|||
|
//DailyTaskDataManager.instance.DoDailyTask(6, 1);
|
|||
|
//DataStatistics.instance.AddRecord("rageSkill", 1);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|