Пример #1
0
        private void OnEnable()
        {
            if (Instance == null)
            {
                Instance = this;
            }
            else if (Instance != null)
            {
                Destroy(Instance.gameObject);
            }

            contentTxt   = GetComponentInChildren <Text>();
            sizeFitter   = contentTxt.GetComponent <ContentSizeFitter>();
            txtRectTrans = contentTxt.GetComponent <RectTransform>();
            tooltipImg   = GetComponentInChildren <Image>();
            bgFadeColor  = tooltipImg.GetComponent <FadeInOut>();
            txtFadeColor = contentTxt.GetComponent <FadeInOut>();
            tooltipTrans = (RectTransform)transform;

            // config
            HideTooltip();
            tooltipTrans.SetAsLastSibling();
        }
Пример #2
0
 private void Start()
 {
     type2Instance = TooltipType2.Instance;
     type1Instance = TooltipType1.Instance;
 }