/// <summary> /// 显示日历 /// </summary> /// <param name="goTarget">目标</param> /// <param name="onCalendarSelected"></param> public void ShowCalendar(GameObject goTarget, OnCalendarSelected onCalendarSelected) { Show(); m_goTarget = goTarget; m_onCalendarSelected = onCalendarSelected; UIUtil.AdjustPos(m_goTarget, m_goWin); m_iYear = DateTime.Now.Year; m_iMonth = DateTime.Now.Month; Refresh(); }
/// <summary> /// 设置日历 /// </summary> /// <param name="goTarget"></param> /// <param name="onCalendarSelected"></param> public static void SetCalendar(GameObject goTarget, OnCalendarSelected onCalendarSelected) { if (goTarget == null) { return; } UIUtil.RemoveClickFunction(goTarget); CustomData.Set(goTarget, new CalendarInputData() { onCalendarSelected = onCalendarSelected }); UIEventListener.Get(goTarget).onClick += OnClickCalendar; }