Files
2025-05-26 20:31:19 +02:00

45 lines
1.1 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DateSelector : MonoBehaviour
{
public int selectedYear;
public int selectedMonth;
public int selectedDay;
public int selectedHour;
public int selectedMinute;
public void SetYear(int yearIndex)
{
selectedYear = yearIndex + 2025; // Achtung: ggf. +Offset je nach Dropdown-Inhalt
}
public void SetMonth(int monthIndex)
{
selectedMonth = monthIndex + 1; // Januar = 0 in Dropdown → Monat = 1
}
public void SetDay(int dayIndex)
{
selectedDay = dayIndex + 1; // 131
}
public void SetHour(int hourIndex)
{
selectedHour = hourIndex; // 023
}
public void SetMinute(int minuteIndex)
{
selectedMinute = minuteIndex * 5; // 059
}
public DateTime selectedDateTime()
{
DateTime dateAndTime = new DateTime(selectedYear, selectedMonth, selectedDay, selectedHour, selectedMinute, 0, DateTimeKind.Utc);
return dateAndTime;
}
}