Files
Northbound/Assets/Scripts/BuildingData.cs

66 lines
2.4 KiB
C#

using UnityEngine;
namespace Northbound
{
[CreateAssetMenu(fileName = "NewBuilding", menuName = "Northbound/Building Data")]
public class BuildingData : ScriptableObject
{
[Header("Building Info")]
public string buildingName;
public GameObject prefab;
[Tooltip("UI에 표시될 건물 아이콘")]
public Sprite icon;
[Header("Grid Size")]
[Tooltip("Width in grid units")]
public int width = 1;
[Tooltip("Length in grid units")]
public int length = 1;
[Tooltip("Height for placement validation")]
public float height = 2f;
[Header("Placement Settings")]
[Tooltip("Offset from grid position")]
public Vector3 placementOffset = Vector3.zero;
[Tooltip("Can rotate this building?")]
public bool allowRotation = true;
[Header("Construction Settings")]
[Tooltip("건설 완료에 필요한 총 작업량")]
public float requiredWorkAmount = 100f;
[Tooltip("1회 상호작용당 작업량")]
public float workPerInteraction = 10f;
[Tooltip("상호작용 쿨다운 (초)")]
public float interactionCooldown = 1f;
[Tooltip("건설 시 플레이어가 재생할 애니메이션 트리거 (예: Build, Hammer, Construct)")]
public string constructionAnimationTrigger = "Build";
[Tooltip("건설 시 사용할 도구 (선택사항)")]
public EquipmentData constructionEquipment;
[Header("Health Settings")]
[Tooltip("Maximum health of the building")]
public int maxHealth = 100;
[Tooltip("Can this building be damaged?")]
public bool isIndestructible = false;
[Tooltip("Auto-regenerate health over time")]
public bool autoRegenerate = false;
[Tooltip("Health regeneration per second")]
public int regenPerSecond = 1;
[Header("Vision Settings")]
[Tooltip("Does this building provide vision?")]
public bool providesVision = true;
[Tooltip("Vision range in world units")]
public float visionRange = 15f;
public Vector3 GetSize(int rotation)
{
// Rotation 0,180 = normal, 90,270 = swap width/length
bool isRotated = (rotation == 1 || rotation == 3);
float w = isRotated ? length : width;
float l = isRotated ? width : length;
return new Vector3(w, height, l);
}
}
}