private void FinishTurnOn() { patch = dataLayers.activeLayerPanels[0].DataLayer.loadedPatchesInView[0]; // Inspector Container if (inspectorContainer == null) { inspectorContainer = Instantiate(inspectorContainerPrefab, canvas.transform); inspectorContainer.name = inspectorContainerPrefab.name; } if (infoPanel != null) { var infoPanelT = infoPanel.transform; int index = infoPanelT.GetSiblingIndex(); inspectorContainer.SetSiblingIndex(index); } // Create output panel for tool if (inspectorOutput == null) { inspectorOutput = Instantiate(outputPrefab); inspectorOutput.name = "Inspector_OutputPanel"; outputPanel.SetPanel(null); } lineInspectorPanel.InitComponentsAndListeners(); lineInspectorPanel.gameObject.SetActive(false); lineInspector.LineInspectionCount = 0; lineInspector.CreatedLineInspectionCount = 0; lineInspector.CurrLineInspection = 0; areaInspectorPanel.InitComponentsAndListeners(); areaInspectorPanel.gameObject.SetActive(false); areaInspector.AreaInspectionCount = 0; areaInspector.CreatedAreaInspectionCount = 0; areaInspector.CurrAreaInspection = -1; SetCursorTexture(cursorDefault); // UI listeners lineModeToggle.onValueChanged.AddListener(OnLinePanelToggleChange); areaModeToggle.onValueChanged.AddListener(OnAreaPanelToggleChange); gridLayerController.OnShowGrid += OnShowGrid; // Initialize grids list with already visible grid layers foreach (var layer in gridLayerController.mapLayers) { lineInspector.LineInspectorGrids.Add(layer.Grid); } OnLinePanelToggleChange(true); }
public void InitComponentsAndListeners() { // Initialize component references mapController = inspectorTool.Map; gridLayerController = mapController.GetLayerController <GridLayerController>(); inspectorOutput = inspectorTool.InspectOutput; dataLayers = ComponentManager.Instance.Get <DataLayers>(); mapViewArea = ComponentManager.Instance.Get <MapViewArea>(); siteBrowser = ComponentManager.Instance.Get <SiteBrowser>(); // Add listeners mapController.OnMapUpdate += OnMapUpdate; mapViewArea.OnMapViewAreaChange += OnMapViewAreaChange; siteBrowser.OnBeforeActiveSiteChange += OnBeforeActiveSiteChange; createAreaInspectionToggle.onValueChanged.AddListener(OnCreateInspectionChanged); removeAreaInspectionToggle.onValueChanged.AddListener(OnRemoveInspectionChanged); }
public void InitComponentsAndListeners() { // Get Components from inspectorTool map = inspectorTool.Map; gridLayerController = map.GetLayerController <GridLayerController>(); patch = inspectorTool.Patch; inspectorOutput = inspectorTool.InspectOutput; dataLayers = ComponentManager.Instance.Get <DataLayers>(); inputHandler = ComponentManager.Instance.Get <InputHandler>(); mapViewArea = ComponentManager.Instance.Get <MapViewArea>(); siteBrowser = ComponentManager.Instance.Get <SiteBrowser>(); // Add listeners map.OnMapUpdate += OnMapUpdate; mapViewArea.OnMapViewAreaChange += OnMapViewAreaChange; siteBrowser.OnBeforeActiveSiteChange += OnBeforeActiveSiteChange; createLineInspectionToggle.onValueChanged.AddListener(OnCreateInspectionChanged); removeLineInspectionToggle.onValueChanged.AddListener(OnRemoveInspectionChanged); }