Example #1
0
        private void AttachToObject(GameObject obj, GameObject owner)
        {
            Transform parent = TriggerUtil.GetChildNodeByName(owner, m_BoneName);

            if (parent == null)
            {
                parent = owner.transform;
            }
            obj.transform.parent = parent;
            UnityEngine.Vector3 world_pos = parent.TransformPoint(m_Postion);
            TriggerUtil.MoveObjTo(obj, world_pos);
            obj.transform.localRotation = UnityEngine.Quaternion.Euler(m_Rotate);
            if (!m_IsAttach)
            {
                obj.transform.parent = null;
            }
        }
Example #2
0
        private AudioSource CreateNewAudioSource(GameObject obj)
        {
            if (string.IsNullOrEmpty(m_AudioSourceName))
            {
                return(null);
            }
            GameObject audiosource_obj = ResourceSystem.NewObject(
                m_AudioSourceName,
                (m_StartTime + m_AudioSourceLifeTime) / 1000.0f) as GameObject;

            if (audiosource_obj == null)
            {
                return(null);
            }
            if (m_IsBoneSound)
            {
                Transform attach_node = TriggerUtil.GetChildNodeByName(obj, m_BoneName);
                if (attach_node != null)
                {
                    audiosource_obj.transform.parent   = attach_node;
                    audiosource_obj.transform.rotation = UnityEngine.Quaternion.identity;
                    audiosource_obj.transform.position = UnityEngine.Vector3.zero;
                    if (!m_IsAttach)
                    {
                        audiosource_obj.transform.parent = null;
                    }
                }
                else
                {
                    audiosource_obj.transform.position = obj.transform.TransformPoint(m_Position);
                    if (m_IsAttach)
                    {
                        audiosource_obj.transform.parent = obj.transform;
                    }
                }
            }
            else
            {
                audiosource_obj.transform.position = obj.transform.TransformPoint(m_Position);
                if (m_IsAttach)
                {
                    audiosource_obj.transform.parent = obj.transform;
                }
            }
            return(audiosource_obj.GetComponent <AudioSource>());
        }
        private void CreateSceneOrBoneCollider(GameObject obj, float liveTime,
                                               object onTriggerEnter,
                                               object onTriggerExit)
        {
            GameObject collider_obj = ResourceSystem.NewObject(m_Prefab, liveTime) as GameObject;

            if (null == collider_obj)
            {
                LogSystem.Error("------create collider failed! " + m_Prefab);
                return;
            }
            m_Collider = collider_obj;
            Component[] transes = collider_obj.GetComponentsInChildren <Transform>();
            for (int i = 0; i < transes.Length; i++)
            {
                transes[i].gameObject.SendMessage("SetOnTriggerEnter", onTriggerEnter, UnityEngine.SendMessageOptions.DontRequireReceiver);
                transes[i].gameObject.SendMessage("SetOnTriggerExit", onTriggerExit, UnityEngine.SendMessageOptions.DontRequireReceiver);
            }

            /*
             * foreach(Transform child in transes) {
             * child.gameObject.SendMessage("SetOnTriggerEnter", onTriggerEnter, SendMessageOptions.DontRequireReceiver);
             * child.gameObject.SendMessage("SetOnTriggerExit", onTriggerExit, SendMessageOptions.DontRequireReceiver);
             * }*/

            if (m_ColliderType == ColliderType.kSceneCollider)
            {
                UnityEngine.Vector3 pos = obj.transform.position + obj.transform.rotation * m_Position;
                collider_obj.transform.position = pos;
            }
            else
            {
                Transform node = TriggerUtil.GetChildNodeByName(obj, m_Bone);
                if (node != null)
                {
                    collider_obj.transform.parent        = node;
                    collider_obj.transform.localPosition = UnityEngine.Vector3.zero;
                    collider_obj.transform.localRotation = UnityEngine.Quaternion.identity;
                    if (!m_IsAttach)
                    {
                        collider_obj.transform.parent = null;
                    }
                }
            }
        }
 private void Init(GameObject obj, SkillInstance instance)
 {
     m_IsInited         = true;
     m_Owner            = obj;
     m_OwnSkill         = instance;
     m_CurHitCountId    = TriggerUtil.NextHitCountId();
     m_LastHitCountTime = instance.CurTime;
     m_DamageManager    = instance.CustomDatas.GetData <SkillDamageManager>();
     if (m_DamageManager == null)
     {
         m_DamageManager = new SkillDamageManager(obj);
         instance.CustomDatas.AddData <SkillDamageManager>(m_DamageManager);
     }
     m_ColliderInfo.CreateTriger(obj, m_RemainTime / 1000.0f,
                                 (object)(MyAction <Collider>) this.OnTriggerEnter,
                                 (object)(MyAction <Collider>) this.OnTriggerExit,
                                 (object)(MyAction)this.OnDestroy);
 }
 public override bool Execute(object sender, SkillInstance instance, long delta, long curSectionTime)
 {
     if (curSectionTime < m_StartTime)
     {
         return(true);
     }
     UnityEngine.GameObject obj = sender as UnityEngine.GameObject;
     if (obj == null)
     {
         return(false);
     }
     UnityEngine.Transform child = TriggerUtil.GetChildNodeByName(obj, m_ChildName);
     if (child != null && child.gameObject != null)
     {
         TriggerUtil.SetObjVisible(child.gameObject, m_IsShow);
     }
     return(false);
 }
        private UnityEngine.Vector3 CalcValidRandomPos(UnityEngine.Vector3 start_pos, UnityEngine.Vector3 random_pos)
        {
            UnityEngine.Vector3 obj_pos = start_pos;
            UnityEngine.Vector3 end_pos = random_pos;
            end_pos.y += 3;
            obj_pos.y  = end_pos.y;
            UnityEngine.RaycastHit hitinfo;
            int layer = 1 << LayerMask.NameToLayer("AirWall");

            if (Physics.Linecast(obj_pos, end_pos, out hitinfo, layer))
            {
                return(TriggerUtil.GetGroundPos(hitinfo.point));
            }
            else
            {
                return(TriggerUtil.GetGroundPos(end_pos));
            }
        }
Example #7
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);
     }
     UnityEngine.GameObject obj = sender as UnityEngine.GameObject;
     if (obj == null)
     {
         return(false);
     }
     UnityEngine.Vector3 old_pos = instance.CustomDatas.GetData <UnityEngine.Vector3>();
     if (old_pos != null)
     {
         obj.transform.position = old_pos;
         TriggerUtil.UpdateObjPosition(obj);
     }
     return(false);
 }
        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);
            }
            UnityEngine.Vector3 center = obj.transform.TransformPoint(m_Center);
            GameObject          target;

            if (m_Relation == CharacterRelation.RELATION_FITSIGNSONS && !m_NeedCollider)
            {
                List <GameObject> area_objects   = TriggerUtil.FindTargetInProgeny(center, m_Radius, obj, m_SignForSkill, m_Degree);
                List <GameObject> filted_objects = FiltStateObjects(area_objects);
                target = TriggerUtil.GetObjectByPriority(obj, filted_objects, m_DistancePriority, m_DegreePriority, m_Radius, m_Degree);
            }
            else
            {
                List <GameObject> area_objects = TriggerUtil.FindTargetInSector(center, m_Radius,
                                                                                obj.transform.forward,
                                                                                obj.transform.position, m_Degree);
                List <GameObject> filted_objects = FiltStateObjects(TriggerUtil.FiltByRelation(obj, area_objects, m_Relation, m_SignForSkill));
                target = TriggerUtil.GetObjectByPriority(obj, filted_objects,
                                                         m_DistancePriority, m_DegreePriority,
                                                         m_Radius, m_Degree);
            }
            if (target != null)
            {
                MoveTargetInfo targetinfo = new MoveTargetInfo();
                targetinfo.Target = target;
                targetinfo.ToTargetDistanceRatio = m_ToTargetDistanceRatio;
                targetinfo.ToTargetConstDistance = m_ToTargetConstDistance;
                targetinfo.IsAdjustMove          = m_IsAdjustMove;
                instance.CustomDatas.AddData <MoveTargetInfo>(targetinfo);
            }
            return(false);
        }
Example #10
0
        public static void MoveChildToNode(GameObject obj, string childname, string nodename)
        {
            Transform child = GetChildNodeByName(obj, childname);

            if (child == null)
            {
                LogSystem.Debug("----not find child! {0} on {1}", childname, obj.name);
                return;
            }
            Transform togglenode = TriggerUtil.GetChildNodeByName(obj, nodename);

            if (togglenode == null)
            {
                LogSystem.Debug("----not find node! {0} on {1}", nodename, obj.name);
                return;
            }
            child.parent        = togglenode;
            child.localRotation = UnityEngine.Quaternion.identity;
            child.localPosition = UnityEngine.Vector3.zero;
        }
Example #11
0
        private void AttachToObjectForRandomRotate(GameObject obj, GameObject owner)
        {
            Transform parent = TriggerUtil.GetChildNodeByName(owner, m_BoneName);

            if (parent == null)
            {
                parent = owner.transform;
            }
            obj.transform.parent = parent;
            UnityEngine.Vector3 world_pos = parent.TransformPoint(m_Postion);
            TriggerUtil.MoveObjTo(obj, world_pos);
            UnityEngine.Vector3 resultrotate = new UnityEngine.Vector3(
                m_Rotate.x + Random.Range(m_RandomRotate.x / -2, m_RandomRotate.x / 2),
                m_Rotate.y + Random.Range(m_RandomRotate.y / -2, m_RandomRotate.y / 2),
                m_Rotate.z + Random.Range(m_RandomRotate.z / -2, m_RandomRotate.z / 2));
            obj.transform.localRotation = UnityEngine.Quaternion.Euler(resultrotate);
            if (!m_IsAttach)
            {
                obj.transform.parent = null;
            }
        }
Example #12
0
 private void Init(GameObject obj)
 {
     m_IsInited            = true;
     m_SummonList          = GetSummonList(obj);
     m_CurIndex            = m_StartIndex;
     m_NextSummonBeginTime = m_StartTime;
     if (m_CurIndex < 0)
     {
         m_CurIndex = 0;
     }
     else
     {
         GameObject target = GetGameObjectByIndex(m_CurIndex);
         if (target != null)
         {
             TriggerUtil.MoveObjTo(obj, target.transform.position);
         }
         m_CurIndex++;
     }
     InitNextSummonInfo(obj);
 }
Example #13
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);
            }
            switch (m_RelativeType)
            {
            case "RelativeOwner":
                SetTransformRelativeOwner(obj);
                break;

            case "RelativeSelf":
                SetTransformRelativeSelf(obj);
                break;

            case "RelativeTarget":
                SetTransformRelativeTarget(obj, instance.CustomDatas.GetData <MoveTargetInfo>());
                break;

            case "RelativeWorld":
                obj.transform.position = m_Postion;
                obj.transform.rotation = UnityEngine.Quaternion.Euler(m_Rotate);
                break;
            }
            if (m_IsUseTerrainHeight)
            {
                UnityEngine.Vector3 terrain_pos = TriggerUtil.GetGroundPos(obj.transform.position);
                obj.transform.position = terrain_pos;
            }
            TriggerUtil.UpdateObjWantDir(obj);
            TriggerUtil.UpdateObjTransform(obj);
            return(false);
        }
Example #14
0
        public void SendImpactToObject(GameObject source, GameObject target, Dictionary <BeHitState, StateImpact> stateimpacts, int skillid, long hit_count_id)
        {
            if (stateimpacts == null)
            {
                return;
            }
            if (IsUserStandUp(target))
            {
                return;
            }
            BeHitState  state       = GetBeHitState(target);
            StateImpact stateimpact = null;

            if (!stateimpacts.TryGetValue(state, out stateimpact))
            {
                stateimpacts.TryGetValue(BeHitState.kDefault, out stateimpact);
            }
            if (stateimpact == null)
            {
                return;
            }
            int        final_skill_id = -1;
            GameObject damageOwner    = TriggerUtil.GetFinalOwner(source, skillid, out final_skill_id);

            //Debug.Log("------------send impact to object " + target.name);
            for (int i = 0; i < stateimpact.m_Impacts.Count; i++)
            {
                LogicSystem.NotifyGfxHitTarget(damageOwner, stateimpact.m_Impacts[i].ImpactId, target, 1, final_skill_id,
                                               stateimpact.m_Impacts[i].RemainTime, source.transform.position,
                                               TriggerUtil.GetObjFaceDir(source), hit_count_id);
            }

            /*
             * foreach (ImpactData im in stateimpact.m_Impacts) {
             * LogicSystem.NotifyGfxHitTarget(damageOwner, im.ImpactId, target, 1, final_skill_id,
             *                                        im.RemainTime, source.transform.position,
             *                                        TriggerUtil.GetObjFaceDir(source), hit_count_id);
             * }*/
        }
Example #15
0
        public override bool IsSatisfied(GameObject obj, SkillInstance instance)
        {
            if (!m_IsIncludeBehitState)
            {
                BeHitState state = SkillDamageManager.GetBeHitState(obj);
                if (state != BeHitState.kStand)
                {
                    return(false);
                }
            }
            float height = TriggerUtil.GetHeightWithGround(obj);

            if (m_IsJudgeFly && height >= m_Height)
            {
                return(true);
            }
            if (!m_IsJudgeFly && height <= m_Height)
            {
                return(true);
            }
            return(false);
        }
Example #16
0
 private UnityEngine.Vector3 Move(GameObject obj, UnityEngine.Vector3 speed_vect, UnityEngine.Vector3 accel_vect, float time)
 {
     m_StartTransform.transform.position = obj.transform.position;
     if (!m_IsLockRotate)
     {
         m_StartTransform.transform.rotation = obj.transform.rotation;
     }
     UnityEngine.Vector3 local_motion = speed_vect * time + accel_vect * time * time / 2;
     UnityEngine.Vector3 word_target_pos;
     while (local_motion.magnitude > m_MaxMoveStep)
     {
         UnityEngine.Vector3 child = UnityEngine.Vector3.ClampMagnitude(local_motion, m_MaxMoveStep);
         local_motion    = local_motion - child;
         word_target_pos = m_StartTransform.transform.TransformPoint(child);
         TriggerUtil.MoveObjTo(obj, word_target_pos);
         m_StartTransform.transform.position = obj.transform.position;
     }
     word_target_pos = m_StartTransform.transform.TransformPoint(local_motion);
     TriggerUtil.MoveObjTo(obj, word_target_pos);
     TriggerUtil.UpdateObjPosition(obj);
     return(speed_vect + accel_vect * time);
 }
Example #17
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_IsInited)
            {
                Init(obj);
            }
            if (m_CurTargetSummon != null)
            {
                long passed_time = curSectionTime - (m_NextSummonBeginTime - m_MoveTime);
                if (passed_time > m_MoveTime)
                {
                    passed_time = m_MoveTime;
                }
                UnityEngine.Vector3 motion_pos = UnityEngine.Vector3.Lerp(m_StartPos, m_CurTargetSummon.transform.position,
                                                                          passed_time * 1.0f / m_MoveTime);
                TriggerUtil.MoveObjTo(obj, motion_pos);
                TriggerUtil.UpdateObjPosition(obj);
            }
            if (m_CurTargetSummon == null || curSectionTime > m_NextSummonBeginTime)
            {
                m_CurIndex++;
                if (m_CurIndex >= m_SummonList.Count || (m_EndIndex >= m_StartIndex && m_CurIndex > m_EndIndex))
                {
                    return(false);
                }
                InitNextSummonInfo(obj);
            }
            return(true);
        }
Example #18
0
        public override bool Execute(object sender, SkillInstance instance, long delta, long curSectionTime)
        {
            if (curSectionTime < m_StartTime)
            {
                return(true);
            }
            UnityEngine.GameObject obj = sender as UnityEngine.GameObject;
            if (obj == null)
            {
                return(false);
            }
            float height = TriggerUtil.GetHeightWithGround(obj);

            if (height <= m_GroundHeight)
            {
                instance.SendMessage(m_Message);
                return(false);
            }
            else
            {
                return(true);
            }
        }
Example #19
0
 public void OnTriggerExit(Collider collider)
 {
     if (m_IsAlwaysEnterDamage)
     {
         m_LeaveDelObjects.Remove(collider.gameObject);
         if (m_DamageManager != null)
         {
             m_DamageManager.RemoveGameObject(collider.gameObject);
             if (m_ColliderInfo.GetAttachConfig().IsAttachEnemy)
             {
                 UnityEngine.Vector3 pos;
                 if (TriggerUtil.NeedCalculateNpcDropPoint(m_DamageManager.GetOwner(), collider.gameObject, out pos))
                 {
                     collider.transform.position = pos;
                 }
             }
         }
     }
     if (m_DamageInterval > 0)
     {
         RemoveMoreTimeEffectObject(collider.gameObject);
     }
 }
        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 (!TriggerUtil.IsPlayerSelf(obj))
            {
                return(false);
            }
            GameObject camera_obj = TriggerUtil.GetCameraObj();

            if (camera_obj != null)
            {
                camera_obj.SendMessage("ResetFollowSpeed");
            }
            return(false);
        }
        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);
        }
Example #22
0
 public override bool Execute(object sender, SkillInstance instance, long delta, long curSectionTime)
 {
     if (curSectionTime < m_StartTime)
     {
         return(true);
     }
     UnityEngine.GameObject obj = sender as UnityEngine.GameObject;
     if (obj == null)
     {
         return(false);
     }
     UnityEngine.Transform part_transform = TriggerUtil.GetChildNodeByName(obj, m_PartName);
     if (part_transform == null || part_transform.gameObject == null)
     {
         LogSystem.Debug("----play part anim: not find part {0}", m_PartName);
         return(false);
     }
     UnityEngine.GameObject     part       = part_transform.gameObject;
     UnityEngine.AnimationState anim_state = part.GetComponent <UnityEngine.Animation>()[m_AnimName];
     if (anim_state == null)
     {
         LogSystem.Debug("----play part anim: not find anim {0}", m_AnimName);
         return(false);
     }
     anim_state.speed    = m_AnimSpeed;
     anim_state.wrapMode = m_WrapMode;
     if (m_FadeLength <= 0)
     {
         part.GetComponent <UnityEngine.Animation>().Play(m_AnimName);
     }
     else
     {
         part.GetComponent <UnityEngine.Animation>().CrossFade(m_AnimName, m_FadeLength);
     }
     return(false);
 }
Example #23
0
        private void LoadStateImpactConfig(ScriptableData.CallData stCall)
        {
            StateImpact stateimpact = TriggerUtil.ParseStateImpact(stCall);

            m_StateImpacts[stateimpact.m_State] = stateimpact;
        }
        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);
        }
Example #25
0
        public override bool Execute(object sender, SkillInstance instance, long delta, long curSectionTime)
        {
            if (curSectionTime >= m_StartTime)
            {
                GameObject obj = sender as GameObject;
                if (null == obj)
                {
                    return(false);
                }
                if (!instance.IsDamageEnable)
                {
                    return(false);
                }

                UnityEngine.Vector3 center         = obj.transform.TransformPoint(m_RelativeCenter);
                Collider[]          hits           = Physics.OverlapSphere(center, m_Range, TriggerUtil.CHARACTER_LAYER);
                SkillDamageManager  damage_manager = instance.CustomDatas.GetData <SkillDamageManager>();
                if (damage_manager == null)
                {
                    damage_manager = new SkillDamageManager(obj);
                    instance.CustomDatas.AddData <SkillDamageManager>(damage_manager);
                }
                if (m_IsShowTip)
                {
                    GameObject circle = TriggerUtil.DrawCircle(center, m_Range, m_Color);
                    GameObject.Destroy(circle, m_ShowTime / 1000.0f);
                }
                long hit_count_id = TriggerUtil.NextHitCountId();
                for (int i = 0; i < hits.Length; i++)
                {
                    if (!SkillDamageManager.IsEnemy(obj, hits[i].gameObject))
                    {
                        continue;
                    }
                    if (SkillDamageManager.IsUserStandUp(hits[i].gameObject))
                    {
                        continue;
                    }
                    if (!damage_manager.IsContainObject(hits[i].gameObject))
                    {
                        damage_manager.IsDamagedEnemy = true;
                        damage_manager.SendImpactToObject(obj, hits[i].gameObject, m_StateImpacts, instance.SkillId, hit_count_id);
                        if (!m_IsClearWhenFinish)
                        {
                            damage_manager.AddDamagedObject(hits[i].gameObject);
                        }
                    }
                }

                /*
                 * foreach (Collider hit in hits) {
                 * if (!SkillDamageManager.IsEnemy(obj, hit.gameObject)) {
                 *  continue;
                 * }
                 * if (SkillDamageManager.IsUserStandUp(hit.gameObject)) {
                 *  continue;
                 * }
                 * if (!damage_manager.IsContainObject(hit.gameObject)) {
                 *  damage_manager.IsDamagedEnemy = true;
                 *  damage_manager.SendImpactToObject(obj, hit.gameObject, m_StateImpacts, instance.SkillId, hit_count_id);
                 *  if (!m_IsClearWhenFinish) {
                 *    damage_manager.AddDamagedObject(hit.gameObject);
                 *  }
                 * }
                 * }*/
                if (damage_manager.IsDamagedEnemy)
                {
                    instance.SendMessage("oncollide");
                }
                return(false);
            }
            else
            {
                return(true);
            }
        }
Example #26
0
 private void SetTransformRelativeSelf(GameObject obj)
 {
     UnityEngine.Vector3 new_pos = obj.transform.TransformPoint(m_Postion);
     TriggerUtil.MoveObjTo(obj, new_pos);
     obj.transform.rotation *= UnityEngine.Quaternion.Euler(m_Rotate);
 }