public override bool Execute(object sender, SkillInstance instance, long delta, long curSectionTime) { if (curSectionTime < m_StartTime) { return(true); } if (curSectionTime > m_StartTime + m_RemainTime) { return(false); } GameObject obj = sender as GameObject; if (obj == null) { return(false); } if (!m_IsInited) { Init(obj); } if (!GfxSystem.IsTouchPosChanged()) { return(true); } UnityEngine.Vector3 pos = GetTouchPos(); UnityEngine.Vector3 lastpos = GetLastPos(); UpdateDamgedObjectCD(delta); bool is_damaged = DamageCrossObjects(obj, instance, pos); if (m_IsHaveMessage && (!m_IsNeedDamage || (m_IsNeedDamage && is_damaged))) { if (curSectionTime >= m_NextMessageTime) { MessageConfig mc = m_MessageConfig[m_CurMessageIndex]; instance.SendMessage(mc.Message); m_NextMessageTime = curSectionTime + mc.NextMessageInterval; m_CurMessageIndex = m_CurMessageIndex + 1 >= m_MessageConfig.Count ? 0 : m_CurMessageIndex + 1; } } m_LastTouchPos = pos; return(true); }
public override bool Execute(object sender, SkillInstance instance, long delta, long curSectionTime) { if (curSectionTime < m_StartTime) { return(true); } if (curSectionTime > m_StartTime + m_RemainTime) { return(false); } GameObject obj = sender as GameObject; if (obj == null) { return(false); } if (!m_IsInited) { Init(obj); } if (m_CurDirectionAnimInfo != null) { m_CurDirectionAnimInfo.Update(); } if (!GfxSystem.IsTouchPosChanged()) { return(true); } UnityEngine.Vector3 pos = GetTouchPos(); UnityEngine.Vector3 lastpos = GetLastPos(); UpdateDamgedObjectCD(delta); bool is_damaged = DamageCrossObjects(obj, instance, pos); UpdateDirectionAnim(pos, lastpos, is_damaged); m_LastTouchPos = pos; return(true); }