mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Scripts: First implementation of Range- and Readonly-Attributes + added support for all primitive types
This commit is contained in:
@@ -2,14 +2,17 @@ using System;
|
||||
|
||||
namespace GlitchyEngine.Editor;
|
||||
|
||||
//public sealed class RangeAttribute : Attribute
|
||||
//{
|
||||
// public float Min { get; set; }
|
||||
// public float Max { get; set; }
|
||||
public sealed class RangeAttribute : Attribute
|
||||
{
|
||||
public double Min { get; set; }
|
||||
public double Max { get; set; }
|
||||
|
||||
// public RangeAttribute(float min, float max)
|
||||
// {
|
||||
// Min = min;
|
||||
// Max = max;
|
||||
// }
|
||||
//}
|
||||
public RangeAttribute(double min, double max)
|
||||
{
|
||||
if (max < min)
|
||||
throw new ArgumentOutOfRangeException(nameof(max), $"{nameof(max)} must be larger than {nameof(min)}.");
|
||||
|
||||
Min = min;
|
||||
Max = max;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user