Beispiel #1
0
	/// <summary>Spawns a given unit
	/// the units alliance must be 
	/// set before this is called
	/// .</summary>
	/// <param name="unit">Unit.</param>
	public void spawnUnit(UnitScript unit, bool spawnWithAI){
		if(spawnWithAI){
			UnitAI ai = new UnitAI(unit);
			unit.ai = ai;
		}
		unit.transform.position = new Vector3();
		unit.transform.SetParent(gridManager.unitObjectHolder);
		unitInstalled = unit;
		unit.spawnUnit(gridManager, this, teamSpawn);
		//Remove this spawn spot.
		removeSpawn();
	}