GameVsJam/3d Prototyp/Assets/Scripts/Utility/SimpleTime.cs

28 lines
567 B
C#
Raw Normal View History

2024-04-05 13:54:38 +02:00
using System;
using UnityEngine;
namespace Utility
{
[Serializable]
public struct SimpleTime
{
[SerializeField, Range(0, 23)]
private byte _hour;
[SerializeField, Range(0, 59)]
private byte _minutes;
public int Hour
{
get => _hour;
set => _hour = (byte)value;
}
public int Minute
{
get => _minutes;
set => _minutes = (byte)value;
}
public TimeSpan ToTimeSpan() => new(_hour, _minutes, 0);
}
}