void OnValidate() { if (!localCastMesh) { localCastMesh = hypercube.castMesh.canvas; } if (localCastMesh) { localCastMesh.setTone(brightness); localCastMesh.updateMesh(); hypercube.sliceModifier.updateSliceModifiers(localCastMesh.getSliceCount(), sliceModifiers); } Shader.SetGlobalFloat("_hypercubeBrightnessMod", brightness); Shader.SetGlobalColor("_blackPoint", blackPoint); updateOverlap(); if (!preview) { preview = GameObject.FindObjectOfType <hypercube.hypercubePreview>(); } if (preview) { preview.updateMesh(); } render(); }
void OnValidate() { if (slices < 1) { slices = 1; } if (!sliceMesh) { return; } if (preview) { preview.sliceCount = slices; preview.sliceDistance = 1f / (float)slices; preview.updateMesh(); } updateMesh(); resetTransform(); }