Files
Emberwild/Assets/GAME/Script/Building/BuildableData.cs
T
2026-07-07 16:43:51 +02:00

46 lines
1.5 KiB
C#

using UnityEngine;
namespace Ashwild.Building
{
/// <summary>
/// Authoring data for one buildable structure shown in the construction menu (a wall, a
/// floor, a door, ...). Mirrors the ScriptableObject-for-data / MonoBehaviour-for-logic
/// split: it carries only what the menu card and the placement ghost need, no behaviour.
/// The final networked spawn will map this to an id later, the same way ItemData does.
/// </summary>
[CreateAssetMenu(fileName = "NewBuildable", menuName = "Building/Buildable Data")]
public class BuildableData : ScriptableObject
{
#region Serialized Fields
[Header("Identity")]
[Tooltip("Name shown on the menu card.")]
[SerializeField] private string displayName;
[Tooltip("Icon shown on the menu card.")]
[SerializeField] private Sprite icon;
[TextArea]
[SerializeField] private string description;
[Header("Prefabs")]
[Tooltip("Semi-transparent preview spawned in the world while positioning the structure.")]
[SerializeField] private GameObject ghostPrefab;
[Tooltip("The real structure spawned once the placement is confirmed.")]
[SerializeField] private GameObject builtPrefab;
#endregion
#region Public API
public string DisplayName => displayName;
public Sprite Icon => icon;
public string Description => description;
public GameObject GhostPrefab => ghostPrefab;
public GameObject BuiltPrefab => builtPrefab;
#endregion
}
}