UnityEssentials
Small but useful tools and features for Unity
MinMax01.cs
Go to the documentation of this file.
1 namespace UnityEngine
2 {
6  public struct MinMax01
7  {
8  public Vector2 min { get; private set; }
9  public Vector2 max { get; private set; }
10 
11  public MinMax01(Vector2 min, Vector2 max)
12  {
13  this.min = new Vector2(Mathf.Clamp01(min.x), Mathf.Clamp01(min.y));
14  this.max = new Vector2(Mathf.Clamp01(max.x), Mathf.Clamp01(max.y));
15  }
16 
17  public MinMax01(float minx, float miny, float maxx, float maxy)
18  {
19  this.min = new Vector2(Mathf.Clamp01(minx), Mathf.Clamp01(miny));
20  this.max = new Vector2(Mathf.Clamp01(maxx), Mathf.Clamp01(maxy));
21  }
22  }
23 }
Class containing a minimum and max Vectors with its components between 0 and 1
Definition: MinMax01.cs:7
MinMax01(float minx, float miny, float maxx, float maxy)
Definition: MinMax01.cs:17
MinMax01(Vector2 min, Vector2 max)
Definition: MinMax01.cs:11