Ejemplo n.º 1
0
    public void RemoveInfoPanel(AnnotationInfoPanel infoPanel, AnnotationVisualization annotation)
    {
        RectTransform rect = infoPanel.GetComponent <RectTransform>();

        annotation.gameObject.SetActive(true);
        StartCoroutine(CloseInfoPanel(rect, annotation));
    }
Ejemplo n.º 2
0
    public void AddInfoPanel(AnnotationVisualization annotation)
    {
        if (infoPanelPrefab != null)
        {
            go = Instantiate(infoPanelPrefab) as GameObject;
            AnnotationInfoPanel infoPanel = go.gameObject.GetComponent <AnnotationInfoPanel>();
            infoPanel.CreateInfoPanel(annotation.data.description, annotation.data.name, (info) => { RemoveInfoPanel(info, annotation); });

            //Added small delay with invoke, because layout updates only after few frames
            Invoke("AddToLayout", 0.1f);

            annotation.gameObject.SetActive(false);
            OpenAnnotations.Add(annotation);

            if (OpenAnnotations.Count > 0 && !animator.GetBool("isOpen"))
            {
                ToggleSidePanel();
            }
        }
    }