示例#1
0
        public static void FixMesh(MeshFilter meshFilter, float fixBoundsRadius)
        {
            HB hb = HB.Instance;

            if (hb == null)
            {
                return;
            }

            Vector3 hbOffset = HBUtils.GetOffset(GetSettings(), fixBoundsRadius);

            meshFilter.sharedMesh = HBUtils.FixMesh(meshFilter.sharedMesh, meshFilter.transform, hbOffset);
        }
示例#2
0
        private void FixMesh(bool global)
        {
            Mesh fixedMesh;

            if (OverrideBounds)
            {
                fixedMesh = HBUtils.FixMesh(OriginalMesh, Bounds);
            }
            else
            {
                fixedMesh = HBUtils.FixMesh(OriginalMesh, transform, HBOffset());
            }

            if (IsGlobalSettingOverriden())
            {
                fixedMesh.name = OriginalMesh.name + " HB Local";
                SetMesh(fixedMesh, true, false);
            }
            else
            {
                if (global)
                {
                    fixedMesh.name = OriginalMesh.name + " HB Global";
                    IsMeshFixed    = true;
                    IsBoundsFixed  = false;
                    if (HB.Instance == null)
                    {
                        throw new System.InvalidOperationException("HB.Instance is null");
                    }
                    HB.Instance.Internal_UpdateMeshInGroup(this, fixedMesh);
                }
                else
                {
                    fixedMesh.name = OriginalMesh.name + " HB Local";
                    SetMesh(fixedMesh, true, false);
                }
            }
        }
示例#3
0
 public static void FixMesh(MeshFilter meshFilter, Vector3 extents)
 {
     meshFilter.sharedMesh = HBUtils.FixMesh(meshFilter.sharedMesh, extents);
 }