27 lines
745 B
C#
27 lines
745 B
C#
using Northbound.Data;
|
|
using Unity.Netcode;
|
|
using UnityEngine;
|
|
|
|
namespace Northbound
|
|
{
|
|
[RequireComponent(typeof(Building))]
|
|
[RequireComponent(typeof(NetworkObject))]
|
|
public class TowerDataComponent : MonoBehaviour
|
|
{
|
|
[Header("Data Reference")]
|
|
[Tooltip("ScriptableObject containing tower data")]
|
|
public TowerData towerData;
|
|
|
|
private void Awake()
|
|
{
|
|
// TowerData now extends BuildingData, so just pass it directly
|
|
Building building = GetComponent<Building>();
|
|
if (building != null && towerData != null)
|
|
{
|
|
building.buildingData = towerData;
|
|
building.initialTeam = TeamType.Player;
|
|
}
|
|
}
|
|
}
|
|
}
|