private void OnMouseUpAsButton() { if (GameObject.Find("PopupSchedule") != null || GameObject.Find("EventPopup") != null) { return; } PopupSchedule.Instantiate(); }
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); }