84 lines
2.7 KiB
C#
84 lines
2.7 KiB
C#
using UnityEngine;
|
|
|
|
namespace Northbound.Data
|
|
{
|
|
[CreateAssetMenu(fileName = "TowerData", menuName = "Northbound/Tower Data")]
|
|
public class TowerData : ScriptableObject
|
|
{
|
|
[Header("Building Info")]
|
|
public string buildingName;
|
|
public GameObject prefab;
|
|
[Tooltip("UI에 표시될 건물 아이콘")]
|
|
public Sprite icon;
|
|
|
|
[Header("Basic Info")]
|
|
[Tooltip("고유 ID")]
|
|
public int id;
|
|
[Tooltip("기획 메모")]
|
|
public string memo;
|
|
[Tooltip("건설 비용")]
|
|
public int mana;
|
|
|
|
[Header("Grid Size")]
|
|
[Tooltip("X 그리드 차지 공간")]
|
|
public int sizeX = 1;
|
|
[Tooltip("Y 그리드 차지 공간")]
|
|
public int sizeY = 1;
|
|
[Tooltip("Z 차지 공간")]
|
|
public int sizeZ = 2;
|
|
|
|
[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 manpower = 100f;
|
|
|
|
[Header("Health Settings")]
|
|
[Tooltip("체력")]
|
|
public int maxHp = 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("사정거리")]
|
|
public int atkRange = 15;
|
|
[Tooltip("Does this building provide vision?")]
|
|
public bool providesVision = true;
|
|
|
|
[Header("Attack Settings")]
|
|
[Tooltip("데미지")]
|
|
public int atkDamage = 10;
|
|
[Tooltip("공격 주기")]
|
|
public float atkIntervalSec = 1f;
|
|
|
|
[Header("Model Settings")]
|
|
[Tooltip("모델 경로")]
|
|
public string modelPath;
|
|
|
|
[Header("Properties for convenience")]
|
|
public int width => sizeX;
|
|
public int length => sizeY;
|
|
public float height => sizeY;
|
|
public int maxHealth => maxHp;
|
|
public float visionRange => atkRange;
|
|
public float requiredWorkAmount => manpower;
|
|
|
|
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, sizeY, l);
|
|
}
|
|
}
|
|
}
|