Esempio n. 1
0
    public void ShowButtonData()
    {
        DataPanel dataPanel = Instantiate(_dataPanelPrefab) as DataPanel;

        dataPanel.gameObject.SetActive(true);
        RectTransform dataRect = dataPanel.GetComponent <RectTransform>();

        dataPanel.transform.SetParent(FindObjectOfType <Canvas>().transform);
        dataPanel.transform.position = circle.transform.position + new Vector3(-dataRect.rect.width / 2, -dataRect.rect.height / 2, 0);

        dataPanel.SetText(data.ToString());
    }