public void SetUpPirate() { PirateManager pirateManager = activePlayer.GetComponent <PirateManager> (); if (pirateManager.piratesCreated < pirateManager.crewSize) { pirateToDeploy = pirateManager.CreatePirate(this.transform); } }
void CreatePirates(GameObject player) { PirateManager pirateManager = player.GetComponent <PirateManager> (); Vector3[] positions = GetPiratePositions(player); for (int i = 0; i < pirateManager.crewSize; i++) { GameObject pirateToDeploy = pirateManager.CreatePirate(player.transform); int xPos = (int)positions [i].x; int zPos = (int)positions [i].z; pirateToDeploy.GetComponent <Pirate>().PlacePirate(player.GetComponent <DeckManager>().RetrieveTile(xPos, zPos)); pirateManager.piratesCreated += 1; } }