private void ShowVictoryScreen(GameManager.PlayerIndex winner) { VictoryImage.sprite = winner == GameManager.PlayerIndex.One ? playerOneImage : playerTwoImage; _winSound.Play(); VictoryPanel.SetActive(true); PausePanel.SetActive(false); }
public void RemovedBlock(BlockController block, GameManager.PlayerIndex player) { if (spawnedBlocks.Contains(block)) { spawnedBlocks.Remove(block); PlayerBlocks[player].Remove(block); Destroy(block.gameObject); } }
public void AddSpawnedBlocks(BlockController block, GameManager.PlayerIndex player) { if (block != null) { spawnedBlocks.Add(block); // Debug.Log(PlayerBlocks.Count); PlayerBlocks[player].Add(block); block.OnBoxDestruction += RemovedBlock; } }
public void Activate(BlockSpawner spawner, GameManager.PlayerIndex ownerId) { blockSpawner = spawner; owner = ownerId; switch (ownerId) { case GameManager.PlayerIndex.One: verticalID = "Vertical"; horizontalID = "Horizontal"; break; case GameManager.PlayerIndex.Two: verticalID = "Verticalp2"; horizontalID = "Horizontalp2"; break; } Active = true; }
// Update is called once per frame void Update() { if (GameManager.IsPaused) { return; } if (GameManager.GetDistanceToFloor(player1.GetTopMostPoint()) > distanceToGoal) { _winner = GameManager.PlayerIndex.One; GameManager.CompleteGame(_winner); print("Spelare 1 är bäst"); } if (GameManager.GetDistanceToFloor(player2.GetTopMostPoint()) > distanceToGoal) { _winner = GameManager.PlayerIndex.Two; GameManager.CompleteGame(_winner); print("Spelare 2 är bäst"); } }
private void ShowWinner(GameManager.PlayerIndex obj) { }
public List <BlockController> GetPlayerBlocks(GameManager.PlayerIndex player) { return(PlayerBlocks[player]); }