Exemplo n.º 1
0
    public void CreatePopUp(int index, string message)
    {
        PopUp preFab = PopUps[index];

        System.Type type = preFab.GetType();
        if (activePopUp == null || activePopUp.GetType() != type)
        {
            if (activePopUp != null)
            {
                activePopUp.Destroy();
            }
            activePopUp = Instantiate(preFab, gameObject.transform, false);
            activePopUp.Setup();
            StartCoroutine(activePopUp.StartPopUp(message));
        }
    }