using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class DateItem : MonoBehaviour { public Text dateText; CalendarPanel calendarPanel; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } public void OnDaySelected(int day) { DateTime selectedDate = new DateTime(calendarPanel.currentDate.Year, calendarPanel.currentDate.Month, day); calendarPanel.selectedDateText.text = "选择的日期: " + selectedDate.ToString("yyyy年MM月dd日"); } }