public static bool GenerateLinearStairsAsset(CSGBrushMeshAsset brushMeshAsset, CSGLinearStairsDefinition definition) { definition.Validate(); int subMeshCount = GetLinearStairsSubMeshCount(definition, definition.leftSide, definition.rightSide); if (subMeshCount == 0) { brushMeshAsset.Clear(); return(false); } CSGBrushSubMesh[] subMeshes; if (brushMeshAsset.SubMeshCount != subMeshCount) { subMeshes = new CSGBrushSubMesh[subMeshCount]; for (int i = 0; i < subMeshCount; i++) { subMeshes[i] = new CSGBrushSubMesh(); } } else { subMeshes = brushMeshAsset.SubMeshes; } if (!GenerateLinearStairsSubMeshes(subMeshes, definition, definition.leftSide, definition.rightSide, 0)) { brushMeshAsset.Clear(); return(false); } brushMeshAsset.SubMeshes = subMeshes; brushMeshAsset.CalculatePlanes(); brushMeshAsset.SetDirty(); return(true); }
public void Validate() { curveSegments = Mathf.Max(curveSegments, 2); stairs.Validate(); }
protected override void OnValidateInternal() { definition.Validate(); base.OnValidateInternal(); }