Started working on building, next to add in spawn location for buildings for units, transporting materials from TownHall/Storage to building site, building naimation continues while building, houses spawn the correct amount of units (not just 1)

This commit is contained in:
2026-06-12 13:58:02 +01:00
parent bd3bb4bc6f
commit d99b2197e5
11 changed files with 469 additions and 10 deletions

View File

@@ -0,0 +1,35 @@
using System;
using UnityEngine;
public class UnitManagement : MonoBehaviour
{
public static UnitManagement Instance;
[SerializeField] GameObject npcPrefab;
void Awake()
{
Instance = this;
}
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public void CreateUnit(String unit, int quantity, Vector3 spawnLocation)
{
for (int i = 0; i < quantity; i++)
{
switch (unit)
{
case "Citizen":
Instantiate(npcPrefab, spawnLocation, Quaternion.identity);
break;
}
}
}
}