private static HelperSurfaceDescription GenerateHelperSurfaceDescription(GeneratedMeshes meshContainer, CSGModel model, ModelSettingsFlags modelSettings, GeneratedMeshDescription meshDescription, RenderSurfaceType renderSurfaceType) { HelperSurfaceDescription helperSurfaceDescription = MeshInstanceManager.CreateHelperSurfaceDescription(meshContainer, modelSettings, meshDescription, renderSurfaceType); helperSurfaceDescription.MeshDescription = meshDescription; if (!UpdateMesh(model, renderSurfaceMeshNames[(int)renderSurfaceType], helperSurfaceDescription.MeshDescription, helperSurfaceDescription.RenderSurfaceType, ref helperSurfaceDescription.HasGeneratedNormals, ref helperSurfaceDescription.SharedMesh, editorOnly: true)) { return(null); } return(helperSurfaceDescription); }
private static bool TryGetHelperSurfaceDescription(GeneratedMeshes meshContainer, CSGModel model, ModelSettingsFlags modelSettings, GeneratedMeshDescription meshDescription, RenderSurfaceType renderSurfaceType, out HelperSurfaceDescription helperSurfaceDescription) { var startGetMeshInstanceTime = EditorApplication.timeSinceStartup; helperSurfaceDescription = MeshInstanceManager.GetHelperSurfaceDescription(meshContainer, modelSettings, meshDescription, renderSurfaceType); getMeshInstanceTime += EditorApplication.timeSinceStartup - startGetMeshInstanceTime; if (helperSurfaceDescription != null && meshDescription == helperSurfaceDescription.MeshDescription && helperSurfaceDescription.SharedMesh && helperSurfaceDescription.IsValid()) { return(true); } helperSurfaceDescription = null; return(true); }