Exemple #1
0
    private void ImportData()
    {
        var importDlg = dialogManager.NewDialog(importDataPrefab);

        importDlg.OnFinishImport.AddListener((site, layer) => {
            RefreshSiteList(site);
        });
    }
    private void OnColorClick(ContoursTool.Snapshot snapshot = null, SnapshotColor snapshotColour = null)
    {
        var popup = dialogManager.NewDialog(colourDialogPrefab);

        var colourImage = snapshotColour.ColourImage;

        if (colourImage != null)
        {
            popup.Show(colourImage.color);
        }

        popup.OnCloseDialog += (result) =>
        {
            if (result.action == DialogAction.Ok)
            {
                // Assign snapshot color in panel
                if (colourImage != null)
                {
                    colourImage.color = popup.Color;
                }

                if (snapshot != null)
                {
                    // Assign snapshot toggle and contour color
                    var toggleButton = snapshot.uiTransform.GetComponentInChildren <Toggle>();
                    var deleteButton = snapshot.uiTransform.GetChild(1).GetComponent <Button>();

                    SetColorsToSnapshot(snapshot.mapLayer, toggleButton, deleteButton, popup.Color);
                    contoursTool.InfoPanel.UpdateSnapshotColour(snapshot.id, popup.Color);
                    if (contoursTool.LegendPanl.LegendItems.TryGetValue(snapshot.id, out LegendItem item))
                    {
                        item.SetDotColor(popup.Color);
                    }
                }
            }
        };
    }