public void SpawnEgg(Position _currentPosition, Unit.Team _team) { Vector3 positionEgg = new Vector3(_currentPosition.X, 0, _currentPosition.Y); GameObject o = Instantiate(_egg, positionEgg, Quaternion.identity); o.GetComponent <Egg>().eggTeam = _team; o.GetComponent <Egg>().Renderer(); }
public static void PositionList(GameObject who, int acts, Unit.Team t) { float dist = Vector2.Distance(who.transform.position, Camera.main.transform.position); if (t == Unit.Team.player && acts > 0 && dist < lowDist) { whoSelect = who; } }
public static void reportActions(Unit.Team team, int acts) { if (team == Unit.Team.player) { playerRoundActions += acts; } else if (team == Unit.Team.enemy) { enemyRoundActions += acts; } }
public bool NoMoreUnitsToMove(Unit.Team team) { foreach (Unit u in units) { if (u.team == team && !u.usedThisTurn) { return(false); } } return(true); }
public static Transform GetSpawnLocation(Unit.Team team) { switch (team) { case Unit.Team.Blue: return(Instance.spawnLocations[1]); default: return(Instance.spawnLocations[0]); } }
public List <Unit> GetUnitsFromTeam(Unit.Team team) { List <Unit> teamList = new List <Unit>(); foreach (Unit unit in units) { if (unit.team == team) { teamList.Add(unit); } } return(teamList); }
public void HandleJoinTeam(Unit.Team team) { playerTeam = team; spawnLocation = ArenaManager.GetSpawnLocation(playerTeam); transform.rotation = spawnLocation.rotation; // rotate clientManager to match spawnLocation SpawnPlayer(); gameState = Global.GameState.Running; }
public Unit createUnitAt(int x, int y, Unit.Team team, UnitStats stats) { Tile t = GetComponent <StageManager>().tiles[x][y]; GameObject go = Instantiate(UnitPrefab, t.transform.position, Quaternion.identity) as GameObject; go.transform.parent = transform; Unit u = go.GetComponent <Unit>(); u.tile = t; t.unit = u; u.team = team; u.stats = stats; return(u); }
public void SpawnUnit(MapTile mapTile, Unit.Team team, string name) { // IMPORTANT! Keep refence synced Unit unit = new Unit(); unit.mapTile = mapTile; mapTile.unit = unit; unit.Init(); unit.team = team; if (Unit.Team.AI == team) { unit.ai = new AIHunter(this, controller, unit); } // add unit to list units.Add(unit); // unit is spawned EventProxyManager.FireEvent(this, new UnitSpawnedEvent(unit)); }
void startTurn() { TurnNumber++; WhoTurn = whoTurn(TurnNumber); if (WhoTurn == Unit.Team.player) { //give player control. ALready done with WhoTurn? SelectNearest(); //move camera if unit not on screen } else if (WhoTurn == Unit.Team.enemy) { //start AI processing for what unit to select and do action //camera follows AI movements / actions } else if (WhoTurn == Unit.Team.neutral) { //do nothing for now? } }
private void SpawnQueen(Transform _positionQueen, Unit.Team team) { GameObject o = Instantiate(_queen, _positionQueenRed.position, Quaternion.identity); o.GetComponent <Queen>().Init(_queenHealth, _queenDamage, _queenMoveSpeed, team); }
internal void SpawnSoldier(Vector3 position, Unit.Team eggTeam) { GameObject o = Instantiate(_soldier, position, Quaternion.identity); o.GetComponent <Soldier>().Init(_soldierHealth, _soldierDamage, _soldierMoveSpeed, eggTeam); }
void newRound() { TurnNumber = 0; WhoTurn = whoTurn(TurnNumber); }