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); }
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); }