// *********************************************************************** // Assembly : Game // Author : Kimch // Created : 2020-09-02 // Description : // Last Modified By : // Last Modified On : // *********************************************************************** // // // *********************************************************************** using System.Collections.Generic; using UnityEngine; namespace G { public class Stat_GeneralCastAction : Stat_BaseAction { private int skillID; private enStat nextStat; public Stat_GeneralCastAction(Stat_StateManager statMgr) : base(statMgr) { } public override bool Enter(Dictionary param, bool clearDelegates = false) { base.Enter(param, clearDelegates); skillID = (int)param["skill_id"]; nextStat = (enStat)(int)param["next_stat"]; string animationName = GetAnimationName(); //m_curAniLength = m_char.PlayAnimation(animationName); if (m_curAniLength == -1f) { m_char.isSkilling = true; AnimationEnd_CB(null); Debug.Log("Could not find animation : " + animationName + "skip "); } m_statMgr.AddTimer(m_curAniLength, AnimationEnd_CB); m_char.isSkilling = true; return true; } public override bool CanTransition(enStat stat) { if (stat == enStat.STAT_ACTION_DEAD) { return true; } bool result = true; if (m_char.isSkilling) { if (stat >= enStat.STAT_ACTION_SKILL && stat <= enStat.STAT_ACTION_SKILL_MAX) { return true; } return false; } return result; } public bool AnimationEnd_CB(object[] param) { Dictionary dictionary = new Dictionary(); dictionary.Add("skill_id", skillID); return SetCurActionState(nextStat, dictionary); } public string GetAnimationName() { switch (m_char.myWeaponType) { case 2: return "cast1"; case 3: return "cast1"; case 4: return "cast1"; case 5: return "cast3"; case 6: return "cast2"; default: return string.Empty; } } } }