데이터파이프라인 타워 부분 개선
This commit is contained in:
26
Assets/Scripts/TowerDataComponent.cs
Normal file
26
Assets/Scripts/TowerDataComponent.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user