namespace UIWidgets { using System; using UnityEngine; /// /// Base class for the SnapGrid. /// public abstract partial class SnapGridBase : UIBehaviourConditional { /// /// Line at X axis. /// [Serializable] public struct LineX { [SerializeField] float x; /// /// X. /// public float X { get { return x; } } [SerializeField] bool snapLeft; /// /// Snap by target left side. /// public bool SnapLeft { get { return snapLeft; } } [SerializeField] bool snapRight; /// /// Snap by target right side. /// public bool SnapRight { get { return snapRight; } } /// /// Create instance. /// public static readonly Func Create = (x, left, right) => new LineX(x, left, right); /// /// Initializes a new instance of the struct. /// /// X. /// Snap by target left side. /// Snap by target right side. public LineX(float x, bool snapLeft = true, bool snapRight = true) { this.x = x; this.snapLeft = snapLeft; this.snapRight = snapRight; } } } }