Пример #1
0
 private void OnMouseUpAsButton()
 {
     if (GameObject.Find("PopupSchedule") != null || GameObject.Find("EventPopup") != null)
     {
         return;
     }
     PopupSchedule.Instantiate();
 }
Пример #2
0
    public static PopupSchedule Instantiate()
    {
        GameObject obj = Instantiate(Resources.Load <GameObject>("Popup/PopupSchedule"));

        if (obj == null || obj.GetComponent <PopupSchedule>() == null)
        {
            Debug.LogError("<color=red> Resource Loading Error!! - PopupSchedule </color>");
            return(null);
        }

        PopupSchedule popup = obj.GetComponent <PopupSchedule>();

        obj.transform.SetParent(m_canvas.transform);
        popup.GetComponent <RectTransform>().localPosition = Vector3.zero;
        popup.GetComponent <RectTransform>().localScale    = Vector3.one;
        popup.name = "PopupSchedule";
        return(popup);
    }