public void OnEnable() { Debug.Log("VoxelEditor.OnEnable"); //voxel = (VoxelMesh)target; //s_voxel = new SerializedObject(voxel); //op = s_voxel.FindProperty("op"); //model = s_voxel.FindProperty("model"); voxel.Init(); SceneView.onSceneGUIDelegate = EditorUpdate; }
void InstanciateNewVoxelMesh() { GameObject newMesh = new GameObject("VoxelMesh"); VoxelMesh voxelMesh = newMesh.AddComponent <VoxelMesh>(); voxelMesh.Init(newMeshSize, isFill, paletteSelected); Selection.activeGameObject = newMesh; EditorUtility.SetDirty(voxelMesh); //for (int x = 0; x < newMeshSize.x; x++) //{ // for (int y = 0; y < newMeshSize.y; y++) // { // for (int z = 0; z < newMeshSize.z; z++) // { // VoxelData vd = voxelMesh.GetVoxel(x, y, z); // EditorUtility.SetDirty(vd.render); // } // } //} }