public void SpawnNewUnit(UnitType unitType, int[] variant) { Spawner s = FindFirstFreeSpawner(); /*AKunit newUnit = (AKunit)Entities.Instance.Create(unitType, Map.Instance); newUnit.Position = s.Position + new Vec3(0, 0, unitType.SpawnHight); newUnit.Rotation = s.Rotation; newUnit.PostCreate();*/ AKunit newUnit = s.CreateUnit(unitType) as AKunit; if (variant != null) { if (EntitySystemWorld.Instance.IsServer() || EntitySystemWorld.Instance.IsSingle()) newUnit.Server_SetVariant(variant); } }