Exemple #1
0
        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 (!TriggerUtil.IsPlayerSelf(obj))
            {
                return(false);
            }
            if (!m_IsInited)
            {
                if (!Init())
                {
                    return(false);
                }
            }
            //m_CameraObj.SendMessage("SetUpPosition");
            if (Camera.main != null)
            {
                Camera.main.transform.Rotate(m_RotateSpeed * TriggerUtil.ConvertToSecond(delta));
            }
            return(true);
        }
        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);
        }
        private void UpdateDamgedObjectCD(long delta)
        {
            float seconds = TriggerUtil.ConvertToSecond(delta);

            for (int i = m_DamageCDObjects.Count - 1; i >= 0; i--)
            {
                DamageObjectInfo info = m_DamageCDObjects[i];
                info.remainDamageCD -= seconds;
                if (info.remainDamageCD < 0)
                {
                    m_DamageCDObjects.RemoveAt(i);
                }
            }
        }
Exemple #4
0
        public override bool Execute(object sender, SkillInstance instance, long delta, long curSectionTime)
        {
            if (curSectionTime < m_StartTime)
            {
                return(true);
            }
            if (curSectionTime > m_StartTime + m_RemainTime || !instance.IsRotateEnable)
            {
                return(false);
            }
            UnityEngine.GameObject obj = sender as UnityEngine.GameObject;
            if (obj == null)
            {
                return(false);
            }

            obj.transform.Rotate(m_RotateSpeed * TriggerUtil.ConvertToSecond(delta));
            return(true);
        }
        public override bool Execute(object sender, SkillInstance instance, long delta, long curSectionTime)
        {
            if (curSectionTime < m_StartTime)
            {
                return(true);
            }
            if (m_IsExecuted && curSectionTime > (m_StartTime + m_RemainTime))
            {
                return(false);
            }
            UnityEngine.GameObject obj = sender as UnityEngine.GameObject;
            if (obj == null)
            {
                return(false);
            }
            m_IsExecuted = true;
            MoveTargetInfo target_info = instance.CustomDatas.GetData <MoveTargetInfo>();

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

            UnityEngine.Vector3 dir = target_info.Target.transform.position - obj.transform.position;
            if (!m_IsHaveRotateSpeed || m_RotateSpeed.y == 0)
            {
                GfxSkillSystem.ChangeDir(obj, (float)Math.Atan2(dir.x, dir.z));
            }
            else
            {
                float maxRotateDelta        = m_RotateSpeed.y * TriggerUtil.ConvertToSecond(delta);
                UnityEngine.Vector3 now_dir = UnityEngine.Vector3.RotateTowards(obj.transform.forward, dir, maxRotateDelta, 0);
                GfxSkillSystem.ChangeDir(obj, (float)Math.Atan2(now_dir.x, now_dir.z));
            }
            return(true);
        }