public override void RebuildMesh() { MeshFilter meshFilter = gameObject.GetComponent <MeshFilter>(); Mesh theNewMesh = (backgroundGeometryStyle == BackgroundGeometryStyle.Tube) ? UIUtils.BuildRoundedRectTubeEx( width, height, margin, radius, circleSubdiv, nbSubdivPerUnit, nbSubdivCornerFixed, nbSubdivCornerPerUnit) : UIUtils.BuildRoundedBoxEx( width, height, margin, thickness, nbSubdivCornerFixed, nbSubdivCornerPerUnit); theNewMesh.name = "UIPanel_GeneratedMesh"; meshFilter.sharedMesh = theNewMesh; UpdateColliderDimensions(); }