private void SetLayer(GameObject hitboxRoot, int layer)
        {
            try
            {
                _subSetLayerInfo.BeginProfileOnlyEnableProfile();
                var hitBoxTransforms = HitBoxComponentUtility.GetHitBoxTransforms(hitboxRoot);
                Logger.InfoFormat("Hitbox_{0} Num:{1}", hitboxRoot, hitBoxTransforms.Count);

                foreach (var v in _colliderList)
                {
                    if (null == v)
                    {
                        continue;
                    }
                    if (!hitBoxTransforms.Contains(v.transform))
                    {
                        v.gameObject.layer = layer;
                    }
                }
            }
            finally
            {
                _subSetLayerInfo.EndProfileOnlyEnableProfile();
            }
        }
Пример #2
0
        private static void SetLayer(GameObject gameObject, int layer)
        {
            var hitBoxTransforms = HitBoxComponentUtility.GetHitBoxTransforms(_thirdModel);

            foreach (var v in gameObject.GetComponentsInChildren <Transform>())
            {
                if (!hitBoxTransforms.Contains(v))
                {
                    v.gameObject.layer = layer;
                }
            }
        }