using System.Collections;
using System.Collections.Generic;
using System.ComponentModel.Design;
using TMPro;
using UnityEngine;
using UnityEngine.UI;

public class switchSceneHandler : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        utilsTools.HideView(gameObject);
    }

    // Update is called once per frame
    void Update()
    {
        
    }
    public void onClose()
    {
        utilsTools.HideView(gameObject);
    }
    public void onSwitch()
    {
        //utilsTools.sendEvent("")
        onClose();
    }
    public void onShowView(Vector3 pos,Vector3 miniSize,ScenePageCellItemData data,Image image)
    {
        utilsTools.ShowView(gameObject);
        var simg = transform.Find("switchImg").GetComponent<Image>();
        simg.sprite = image.sprite;
        var close = transform.Find("close");
        var name = transform.Find("name");
        var actBtn = transform.Find("ackswitch");
        var bangray = transform.Find("bangray");
        close.gameObject.SetActive(false);
        name.gameObject.SetActive(false);
        actBtn.gameObject.SetActive(false);
        bangray.gameObject.SetActive(false);
        name.GetComponent<TextMeshProUGUI>().text = data.name;
        utilsTools.addTimer_Sec(gameObject, "wait", (string name1) =>
        {
            close.gameObject.SetActive(true);
            name.gameObject.SetActive(true);
            actBtn.gameObject.SetActive(true);
            bangray.gameObject.SetActive(true);
            return false;
        }, 4);
    }
}
