public override bool Execute(object sender, SkillInstance instance, long delta, long curSectionTime)
        {
            if (curSectionTime < m_StartTime)
            {
                return(true);
            }
            if (curSectionTime > m_StartTime + m_RemainTime)
            {
                if (TriggerUtil.IsControledCamera(m_CameraControlId))
                {
                    TriggerUtil.ControlCamera(false);
                }
                return(false);
            }

            GameObject obj = sender as GameObject;

            if (obj == null)
            {
                return(false);
            }

            if (!m_IsInited)
            {
                if (!Init(instance))
                {
                    return(false);
                }
            }
            if (!TriggerUtil.IsControledCamera(m_CameraControlId))
            {
                return(false);
            }
            float now = instance.CurTime / 1000.0f;

            m_XShakeInfo.Tick(now);
            m_YShakeInfo.Tick(now);
            m_ZShakeInfo.Tick(now);
            UnityEngine.Vector3 new_pos = new UnityEngine.Vector3(m_XShakeInfo.CurPos, m_YShakeInfo.CurPos, m_ZShakeInfo.CurPos);
            if (m_IsRelativeUser)
            {
                new_pos = new_pos - m_CameraOriginPos;
                new_pos = obj.transform.TransformPoint(new_pos);
                new_pos = new_pos - obj.transform.position;
                new_pos = m_CameraOriginPos + new_pos;
            }
            if (m_IsFollow)
            {
                Camera.main.transform.position = m_LastCameraFollowPos;
                if (m_CameraObject != null)
                {
                    m_CameraObject.SendMessage("Apply");
                }
                m_LastCameraFollowPos = Camera.main.transform.position;
                new_pos = Camera.main.transform.position + (new_pos - m_CameraOriginPos);
            }
            Camera.main.transform.position = new_pos;
            return(true);
        }
 public override void Reset()
 {
     m_IsInited = false;
     if (TriggerUtil.IsControledCamera(m_CameraControlId))
     {
         TriggerUtil.ControlCamera(false);
     }
     m_CameraControlId = TriggerUtil.CAMERA_CONTROL_FAILED;
 }
        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);
            }
            if (!m_IsCurveMoving)
            {
                return(false);
            }
            if (!TriggerUtil.IsPlayerSelf(obj))
            {
                return(false);
            }
            if (!m_IsInited)
            {
                if (!Init(instance))
                {
                    return(false);
                }
            }
            if (m_SectionListCopy.Count == 0 || !instance.IsCurveMoveEnable)
            {
                m_IsCurveMoving = false;
                return(false);
            }
            if (!TriggerUtil.IsControledCamera(m_CameraControlId))
            {
                return(false);
            }

            m_Now += TriggerUtil.ConvertToSecond((long)(instance.OrigDelta * instance.MoveScale));
            MoveSectionInfo cur_section = m_SectionListCopy[0];

            if (m_Now - cur_section.startTime > cur_section.moveTime)
            {
                float end_time  = cur_section.startTime + cur_section.moveTime;
                float used_time = end_time - cur_section.lastUpdateTime;
                cur_section.curSpeedVect = Move(cur_section.curSpeedVect, cur_section.accelVect, used_time);
                m_SectionListCopy.RemoveAt(0);
                if (m_SectionListCopy.Count > 0)
                {
                    cur_section                = m_SectionListCopy[0];
                    cur_section.startTime      = end_time;
                    cur_section.lastUpdateTime = end_time;
                    cur_section.curSpeedVect   = cur_section.speedVect;
                }
                else
                {
                    m_IsCurveMoving = false;
                }
            }
            else
            {
                cur_section.curSpeedVect   = Move(cur_section.curSpeedVect, cur_section.accelVect, m_Now - cur_section.lastUpdateTime);
                cur_section.lastUpdateTime = m_Now;
            }
            if (m_IsLookAt)
            {
                m_CameraObj.SendMessage("LookAtTarget");
            }
            return(true);
        }