namespace UIWidgets
{
using System;
using UnityEngine;
///
/// Base class for the SnapGrid.
///
public abstract partial class SnapGridBase : UIBehaviourConditional
{
///
/// Line at Y axis.
///
[Serializable]
public struct LineY
{
[SerializeField]
float y;
///
/// Y.
///
public float Y
{
get
{
return y;
}
}
[SerializeField]
bool snapBottom;
///
/// Snap by target bottom side.
///
public bool SnapBottom
{
get
{
return snapBottom;
}
}
[SerializeField]
bool snapTop;
///
/// Snap by target top side.
///
public bool SnapTop
{
get
{
return snapTop;
}
}
///
/// Create instance.
///
public static readonly Func Create = (y, bottom, top) => new LineY(y, bottom, top);
///
/// Initializes a new instance of the struct.
///
/// Y.
/// Snap by target bottom side.
/// Snap by target top side.
public LineY(float y, bool snapBottom = true, bool snapTop = true)
{
this.y = y;
this.snapBottom = snapBottom;
this.snapTop = snapTop;
}
}
}
}