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); }
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); } } }
public static void FixMesh(MeshFilter meshFilter, Vector3 extents) { meshFilter.sharedMesh = HBUtils.FixMesh(meshFilter.sharedMesh, extents); }