コード例 #1
0
    public void CreateInfoTag(Info content, Transform anchor)
    {
        InfoTag infoTag = Instantiate(infoTagPrefab).GetComponent <InfoTag>();

        infoTag.transform.SetParent(anchor, false);

        infoTag.gameObject.SetActive(true);

        infoTag.Show(content);
    }
コード例 #2
0
    internal void ShowInfoTag(TagAnchor.Orientation orientation)
    {
        float offset = infoTag.transform.Find("Background").GetComponent <RectTransform>().sizeDelta.x + transform.Find("Canvas").GetComponent <RectTransform>().sizeDelta.x * 0.5f;

        if (orientation == TagAnchor.Orientation.LEFT)
        {
            infoTag.transform.localPosition = new Vector3(-offset * infoTag.transform.localScale.x, infoTag.transform.localPosition.y, infoTag.transform.localPosition.z);
        }

        infoTag.gameObject.SetActive(true);
        infoTag.Show(content, imagePath);
    }