This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public static class DateTimeUtils | |
{ | |
/// <summary> By default, <see cref="DateTimeExtensions"/> and <see cref="DateTimeUtils"/> will offset the hour by this value to match Cardinal Direction. Means, degree of zero will equal to 18:00 in a circle </summary> | |
public const float DefaultOffsetHour = 18f; | |
public const float ExactHourDegree = (360f / 24f); // 1 hour = 15 degree | |
public const float ExactMinutePoint = (ExactHourDegree / 60f); // 1 min = 0,25 degree |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public static class BoxCollider2DExtensions | |
{ | |
public static Vector2 GetRandomPoint(this BoxCollider2D a) | |
{ | |
Vector2 extents = a.bounds.extents; | |
Vector2 localPoint = new ( | |
Random.Range(-extents.x, extents.x), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
/// <summary> Customizes the field shown in inspector and clamps the values as <see cref="RangeAttribute"/> does </summary> | |
public sealed partial class VectorRangeAttribute : PropertyAttribute | |
{ | |
public readonly (float minX, float maxX, float minY, float maxY, float minZ, float maxZ, float minW, float maxW) clamped; | |
public VectorRangeAttribute | |
( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public enum TimeType | |
{ | |
None, | |
Scaled, | |
Unscaled, | |
} |