proto_rts/Assets/Scripts/AddToTeam.cs

25 lines
448 B
C#
Raw Normal View History

using UnityEngine;
// TODO: remove me!
public class AddToTeam : MonoBehaviour
{
public bool addToBuilding;
private void Start()
{
var building = GetComponent<Building>();
if (addToBuilding)
{
Team.AllBuildings.Add(building);
}
var unit = GetComponent<Unit>();
if (!addToBuilding)
{
Team.AllUnits.Add(unit);
}
Destroy(this);
}
}