public static CSGBrush CreateCubeBrush(UnityEngine.Transform parent, string brushName, UnityEngine.Vector3 size) { ControlMesh controlMesh; Shape shape; BrushFactory.CreateCubeControlMesh(out controlMesh, out shape, size); return(CreateBrush(parent, brushName, controlMesh, shape)); }
public static bool SetBrushCubeMesh(CSGBrush brush, UnityEngine.Vector3 size) { if (!brush) { return(false); } ControlMesh controlMesh; Shape shape; BrushFactory.CreateCubeControlMesh(out controlMesh, out shape, size); brush.ControlMesh = controlMesh; brush.Shape = shape; if (brush.ControlMesh != null) { brush.ControlMesh.SetDirty(); } if (brush.Shape != null) { ShapeUtility.EnsureInitialized(brush.Shape); } return(true); }