void SpawnSheeps(bool isWhite, int sheepIndex, int laneIndex) { if (isWhite) { Sheep sheep = Instantiate <Sheep>(whiteSheeps[sheepIndex], wSpawnPositions[laneIndex].position, Quaternion.identity, wSpawnPositions[laneIndex]); sheep.BeSpawned(laneIndex); gameUI.SendTurn(sheepIndex, laneIndex); } else { Sheep sheep = Instantiate <Sheep>(blackSheeps[sheepIndex], bSpawnPositions[laneIndex].position, Quaternion.identity, bSpawnPositions[laneIndex]); sheep.BeSpawned(laneIndex); } }
public IEnumerator PrepareSheep(int sheepIndex, int laneIndex) { if (currentSheep == null) { currentSheep = Instantiate <Sheep>(whiteSheeps[sheepIndex], wSpawnPositions[laneIndex].position, Quaternion.identity, wSpawnPositions[laneIndex]); currentSheep.laneIndex = laneIndex; yield return(new WaitForSeconds(coolDown)); currentSheep.BeSpawned(currentSheep.laneIndex); gameUI.SendTurn(sheepIndex, currentSheep.laneIndex); NextTurn(); } else { currentSheep.transform.position = wSpawnPositions[laneIndex].position; currentSheep.laneIndex = laneIndex; } }