public override void OnLevelLoaded(LoadMode mode) { var toolController = ToolsModifierControl.toolController; if (toolController == null) { Debug.LogError("ExtraTools#OnLevelLoaded(): ToolContoller not found"); return; } try { var extraTools = NaturalResourcesBrush.SetUpExtraTools(mode, toolController); NaturalResourcesBrush.AddExtraToolsToController(toolController, extraTools); } catch (Exception e) { Debug.LogError(e); } finally { if (toolController.Tools.Length > 0) { toolController.Tools[0].enabled = true; } } if (OptionsWrapper <Options> .Options.terrainTool && GetPanels().ContainsKey(LandscapingInfoPanel)) { landscapingPanel = GetPanels()[LandscapingInfoPanel]; if (landscapingPanel != null) { GetPanels().Remove(LandscapingInfoPanel); } LandscapingPanelDetour.Initialize(); } }
public override void OnLevelLoaded(LoadMode mode) { var toolController = ToolsModifierControl.toolController; if (toolController == null) { Debug.LogError("ExtraTools#OnLevelLoaded(): ToolContoller not found"); return; } try { var extraTools = NaturalResourcesBrush.SetUpExtraTools(mode, toolController); NaturalResourcesBrush.AddExtraToolsToController(toolController, extraTools); } catch (Exception e) { Debug.LogError(e); } finally { if (toolController.Tools.Length > 0) { toolController.Tools[0].enabled = true; } } if (OptionsWrapper <Options> .Options.terrainTool && GetPanels().ContainsKey(LandscapingInfoPanel)) { landscapingPanel = GetPanels()[LandscapingInfoPanel]; if (landscapingPanel != null) { GetPanels().Remove(LandscapingInfoPanel); } LandscapingPanelDetour.Initialize(); } var beautificationPanels = Object.FindObjectsOfType <BeautificationPanel>(); beautificationPanels.ForEach(p => { p.component.eventVisibilityChanged -= HideBrushOptionsPanel(); p.component.eventVisibilityChanged += HideBrushOptionsPanel(); }); }