/// <summary> /// Removes and adds all listeners. /// </summary> private void ReConnectEvents() { mainPanel.RemoveEventlisteners(SceneView.currentDrawingSceneView); mainPanel.AddEventListeners(SceneView.currentDrawingSceneView); fileManager.RemoveEventlisteners(SceneView.currentDrawingSceneView); fileManager.AddEventListeners(SceneView.currentDrawingSceneView); fileManager.OnVoxelMapChangedEvent -= FileManager_OnVoxelMapChangedEvent; fileManager.OnVoxelMapChangedEvent += FileManager_OnVoxelMapChangedEvent; fileManager.OnVoxelSwatchChangedEvent -= FileManager_OnVoxelSwatchChangedEvent; fileManager.OnVoxelSwatchChangedEvent += FileManager_OnVoxelSwatchChangedEvent; swatchPanel.RemoveEventlisteners(SceneView.currentDrawingSceneView); swatchPanel.AddEventListeners(SceneView.currentDrawingSceneView); modePanel.RemoveEventlisteners(SceneView.currentDrawingSceneView); modePanel.AddEventListeners(SceneView.currentDrawingSceneView); chunkPanel.RemoveEventlisteners(SceneView.currentDrawingSceneView); chunkPanel.AddEventListeners(SceneView.currentDrawingSceneView); }