Example #1
0
    private void Start()
    {
        canvas = GameObject.Find("Overlay").GetComponent <Canvas>();
        if (canvas == null)
        {
            Debug.Log("CANVAS NOT FOUND");
        }
        this.canvasRect = canvas.GetComponent <RectTransform>();
        uiOffset        = new Vector2((float)canvasRect.sizeDelta.x / 2f, (float)canvasRect.sizeDelta.y / 2f);
        actionButton.onClick.AddListener(OnActionButtonClicked);
        title.text = versionedObject.objectName;

        this.transform.SetParent(canvas.transform);

        string[] description = versionedObject.DescribeStagedState().Split('\n');
        Debug.Log(description);
        if (description.Length >= 1)
        {
            versionablePropertyOne.text = description[0];
        }
        if (description.Length == 2)
        {
            versionablePropertyTwo.gameObject.SetActive(true);
            versionablePropertyTwo.text = description[1];
        }
    }