示例#1
0
        public override bool Execute(object sender, SkillInstance instance, long delta, long curSectionTime)
        {
            if (curSectionTime < m_StartTime)
            {
                return(true);
            }
            GameObject obj = sender as GameObject;

            if (obj == null)
            {
                return(false);
            }
            MoveTargetInfo target_info = instance.CustomDatas.GetData <MoveTargetInfo>();

            if (target_info == null || target_info.Target == null)
            {
                return(false);
            }

            if (m_IsGrab)
            {
                if (!m_IsInited)
                {
                    if (!Init(target_info.Target))
                    {
                        return(false);
                    }
                }
                if (TriggerUtil.AttachNodeToNode(obj, m_SourceNode, target_info.Target, m_TargetNode))
                {
                    TriggerUtil.UpdateObjPosition(target_info.Target);
                }
                if (curSectionTime < m_StartTime + m_UpdateTime)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                target_info.Target.transform.parent = null;
                UnityEngine.Vector3 pos;
                if (TriggerUtil.NeedCalculateNpcDropPoint(obj, target_info.Target, out pos))
                {
                    target_info.Target.transform.position = pos;
                }
                return(false);
            }
        }