Hey Alex
Again thank you for code. could you please help me with another problem with our code.
We have a prefab with 4 text strings that loads as a tooltip. I would just like to know how its possible to pass the different values. currently in the sample its using GetComponentInChildren and this only sets the value for the first text object in the parent. We have tried doing it by tag and keep getting a error (UnityEngine.GameObject.FindGameObjectsWithTag(string)' cannot be accessed with an instance reference, qualify it with a type name instead).
how can we solve this?
we are using it like this:
private void OnUpdateLate()
{
if (tooltipMarker != null)
{
if (tooltip == null)
{
tooltip = Instantiate(tooltipPrefab);
(tooltip.transform as RectTransform).SetParent(container.transform);
}
//Vector2 pos = new Vector2(rect.center.x, rect.yMin + 90);
Vector2 screenPosition = OnlineMapsControlBase.instance.GetScreenPosition(tooltipMarker.position);
screenPosition.y += tooltipMarker.height+60;
Vector2 point;
RectTransformUtility.ScreenPointToLocalPointInRectangle(container.transform as RectTransform, screenPosition, null, out point);
(tooltip.transform as RectTransform).localPosition = point;
//tooltip.GetComponentInChildren<Text>().text = tooltipMarker.label;
tooltip.FindGameObjectsWithTag("User_Id");
}
else
{
DestroyImmediate(tooltip);
tooltip = null;
}
}
Could anyone please assist?