| | 1 | | using System; |
| | 2 | | using UnityEngine; |
| | 3 | |
|
| | 4 | | namespace DCL.UIElements.Structures |
| | 5 | | { |
| | 6 | | public struct DCLUVs : IEquatable<DCLUVs> |
| | 7 | | { |
| 1 | 8 | | public static readonly DCLUVs Default = new (Vector2.zero, Vector2.up, Vector2.one, Vector2.right); |
| | 9 | |
|
| | 10 | | public Vector2 BottomLeft; |
| | 11 | | public Vector2 TopLeft; |
| | 12 | | public Vector2 TopRight; |
| | 13 | | public Vector2 BottomRight; |
| | 14 | |
|
| | 15 | | public DCLUVs(Vector2 bottomLeft, Vector2 topLeft, Vector2 topRight, Vector2 bottomRight) |
| | 16 | | { |
| 1 | 17 | | this.BottomLeft = bottomLeft; |
| 1 | 18 | | this.TopLeft = topLeft; |
| 1 | 19 | | this.TopRight = topRight; |
| 1 | 20 | | this.BottomRight = bottomRight; |
| 1 | 21 | | } |
| | 22 | |
|
| | 23 | | public bool Equals(DCLUVs other) => |
| 1 | 24 | | BottomLeft.Equals(other.BottomLeft) && TopLeft.Equals(other.TopLeft) && TopRight.Equals(other.TopRight) && B |
| | 25 | |
|
| | 26 | | public override bool Equals(object obj) => |
| 0 | 27 | | obj is DCLUVs other && Equals(other); |
| | 28 | |
|
| | 29 | | public override int GetHashCode() => |
| 0 | 30 | | HashCode.Combine(BottomLeft, TopLeft, TopRight, BottomRight); |
| | 31 | | } |
| | 32 | | } |