Ejemplo n.º 1
0
    public void Close()
    {
        if (currentOpenPanel == this)
            currentOpenPanel = null;

        Destroy(gameObject);
    }
Ejemplo n.º 2
0
    public static void Open(MapNode node)
    {
        GameObject obj = (GameObject) Instantiate(Resources.Load("GUI/LocationInfoPanel"));
        obj.transform.SetParent(GameObject.Find("ScreenSpaceCanvas").transform, false);

        LocationInfoPanel panel = obj.GetComponent<LocationInfoPanel>();
        panel.locationData = MapLocationDatabase.Instance.GetLocationData(node.locationID);
        panel.mapNode = node;

        if (currentOpenPanel != null)
            currentOpenPanel.Close();

        currentOpenPanel = panel;
    }