Exemplo n.º 1
0
        protected override void Load(ScriptableData.CallData callData)
        {
            if (callData.GetParamNum() > 1)
            {
                m_StartTime    = int.Parse(callData.GetParamId(0));
                m_IsLockRotate = bool.Parse(callData.GetParamId(1));
            }
            m_SectionList.Clear();
            int section_num = 0;

            while (callData.GetParamNum() >= 7 * (section_num + 1) + 2)
            {
                MoveSectionInfo section = new MoveSectionInfo();
                section.moveTime    = (float)System.Convert.ToDouble(callData.GetParamId((section_num * 7) + 2));
                section.speedVect.x = (float)System.Convert.ToDouble(callData.GetParamId((section_num * 7) + 3));
                section.speedVect.y = (float)System.Convert.ToDouble(callData.GetParamId((section_num * 7) + 4));
                section.speedVect.z = (float)System.Convert.ToDouble(callData.GetParamId((section_num * 7) + 5));
                section.accelVect.x = (float)System.Convert.ToDouble(callData.GetParamId((section_num * 7) + 6));
                section.accelVect.y = (float)System.Convert.ToDouble(callData.GetParamId((section_num * 7) + 7));
                section.accelVect.z = (float)System.Convert.ToDouble(callData.GetParamId((section_num * 7) + 8));
                m_SectionList.Add(section);
                section_num++;
            }
            if (m_SectionList.Count == 0)
            {
                return;
            }
            m_IsCurveMoving = true;
        }
Exemplo n.º 2
0
        public MoveSectionInfo Clone()
        {
            MoveSectionInfo copy = new MoveSectionInfo();

            copy.moveTime  = moveTime;
            copy.speedVect = speedVect;
            copy.accelVect = accelVect;
            return(copy);
        }
Exemplo n.º 3
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);
            }
            if (!m_IsCurveMoving)
            {
                return(false);
            }
            if (!m_IsInited)
            {
                Init(obj, instance);
            }
            if (m_SectionListCopy.Count == 0 || !instance.IsCurveMoveEnable)
            {
                m_IsCurveMoving = false;
                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(obj, 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(obj, cur_section.curSpeedVect, cur_section.accelVect, m_Now - cur_section.lastUpdateTime);
                cur_section.lastUpdateTime = m_Now;
            }
            return(true);
        }