Fixed current day of week calculation
This commit is contained in:
28
3d Prototyp/Assets/Scripts/Utility/SimpleTime.cs
Normal file
28
3d Prototyp/Assets/Scripts/Utility/SimpleTime.cs
Normal file
@ -0,0 +1,28 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user