using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GameManager : SingletonComponent<GameManager>
{

    private void Awake()
    {
        //Time.timeScale = 4f;
        toolTipOff(null);
    }

    public string toolTipTag;
    public TooltipPopup tooltipPopup;

    public void toolTipOn(string nowToolTipTag, Vector3 pos, Vector2 pivot, string content, string name = null)
    {
        this.toolTipTag = nowToolTipTag;
        tooltipPopup.nameText.text = name;
        tooltipPopup.nameText.gameObject.SetActive(string.IsNullOrEmpty(name) == false);
        tooltipPopup.contentText.text = content;
        tooltipPopup.Rect.position = pos;
        tooltipPopup.pivotTran.pivot = pivot;
        tooltipPopup.pivotTran.anchoredPosition = Vector2.zero;
        tooltipPopup.gameObject.SetActive(true);
    }
    public void toolTipOff(string nowToolTipTag)
    {
        if (string.IsNullOrEmpty(nowToolTipTag) || this.toolTipTag == nowToolTipTag)
        {
            this.toolTipTag = null;
            tooltipPopup.gameObject.SetActive(false);
        }
    }

}
