Example #1
0
	protected void doGeneralPropertiesGUI(Vox.VoxelEditor editor) {
		bool createColliders = EditorGUILayout.Toggle(new GUIContent("Generate Colliders"), editor.createColliders);
		bool useStaticMeshes = EditorGUILayout.Toggle(new GUIContent("Use Static Meshes"), editor.useStaticMeshes);
		bool saveMeshes = EditorGUILayout.Toggle(new GUIContent("Save Meshes To Scene"), editor.saveMeshes);
		bool reduceMeshes = EditorGUILayout.Toggle(new GUIContent("Reduce Meshes"), editor.reduceMeshes);
		float reductionAmount = editor.reductionAmount;
		if (editor.reduceMeshes) {
			reductionAmount = doSliderFloatField("Mesh Reduction Level", editor.reductionAmount, 0, 0.5f);
		}
		byte maxDetail = (byte)EditorGUILayout.IntField(new GUIContent("Voxel Power"), editor.maxDetail);
		if (maxDetail != editor.maxDetail || createColliders != editor.createColliders ||
			saveMeshes != editor.saveMeshes || reductionAmount != editor.reductionAmount ||
			useStaticMeshes != editor.useStaticMeshes || reduceMeshes != editor.reduceMeshes) {
			if (maxDetail != editor.maxDetail) {
				editor.maxDetail = maxDetail;
				editor.setupLookupTables();
			}
			editor.createColliders = createColliders;
			editor.useStaticMeshes = useStaticMeshes;
			editor.saveMeshes = saveMeshes;
            editor.reduceMeshes = reduceMeshes;
			editor.reductionAmount = reductionAmount;
			editor.clearRenderers();
		}
	}