Пример #1
0
    private void Awake()
    {
        eventSystem       = FindObjectOfType <EventSystem>();
        tooltipController = FindObjectOfType <BuildingTooltipController>();

        // Add a new tooltip prefab if one does not exist yet
        if (!tooltipController)
        {
            tooltipController = AddTooltipPrefabToScene();
        }
        if (!tooltipController)
        {
            Debug.LogWarning("Could not find the Tooltip prefab");
        }

        if (GetComponent <RectTransform>())
        {
            isUIObject = true;
        }
    }
Пример #2
0
 private void Awake()
 {
     m_Cursor  = FindObjectOfType <MapCursor>();
     m_Tooltip = FindObjectOfType <BuildingTooltipController>();
 }