예제 #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
파일: Tooltip.cs 프로젝트: dqtoy/Assets
 private void Start()
 {
     type2Instance = TooltipType2.Instance;
     type1Instance = TooltipType1.Instance;
 }