53 lines
1.5 KiB
C#
53 lines
1.5 KiB
C#
using UnityEngine;
|
|
|
|
namespace Ashwild.UI
|
|
{
|
|
/// <summary>
|
|
/// Visual configuration for one crosshair state (e.g. the idle dot or the
|
|
/// interact hand): which sprite to show, its tint and its size. Authored as a
|
|
/// ScriptableObject so the look is tuned in the editor without touching code.
|
|
/// </summary>
|
|
[CreateAssetMenu(fileName = "CrosshairState", menuName = "UI/Crosshair State")]
|
|
public class CrosshairState : ScriptableObject
|
|
{
|
|
#region Serialized Fields
|
|
|
|
[Header("Appearance")]
|
|
/// <summary>
|
|
/// Sprite the crosshair icon shows while in this state.
|
|
/// </summary>
|
|
[SerializeField] private Sprite sprite;
|
|
|
|
/// <summary>
|
|
/// Tint applied to the crosshair icon in this state.
|
|
/// </summary>
|
|
[SerializeField] private Color color = Color.white;
|
|
|
|
/// <summary>
|
|
/// Icon size (RectTransform sizeDelta, in pixels) for this state.
|
|
/// </summary>
|
|
[SerializeField] private Vector2 size = new Vector2(8f, 8f);
|
|
|
|
#endregion
|
|
|
|
#region Public API
|
|
|
|
/// <summary>
|
|
/// Sprite the crosshair icon shows while in this state.
|
|
/// </summary>
|
|
public Sprite Sprite => sprite;
|
|
|
|
/// <summary>
|
|
/// Tint applied to the crosshair icon in this state.
|
|
/// </summary>
|
|
public Color Color => color;
|
|
|
|
/// <summary>
|
|
/// Icon size (RectTransform sizeDelta, in pixels) for this state.
|
|
/// </summary>
|
|
public Vector2 Size => size;
|
|
|
|
#endregion
|
|
}
|
|
}
|