Esempio n. 1
0
 private void ShowVictoryScreen(GameManager.PlayerIndex winner)
 {
     VictoryImage.sprite = winner == GameManager.PlayerIndex.One ? playerOneImage : playerTwoImage;
     _winSound.Play();
     VictoryPanel.SetActive(true);
     PausePanel.SetActive(false);
 }
Esempio n. 2
0
 public void RemovedBlock(BlockController block, GameManager.PlayerIndex player)
 {
     if (spawnedBlocks.Contains(block))
     {
         spawnedBlocks.Remove(block);
         PlayerBlocks[player].Remove(block);
         Destroy(block.gameObject);
     }
 }
Esempio n. 3
0
 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;
     }
 }
Esempio n. 4
0
    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;
    }
Esempio n. 5
0
    // 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");
        }
    }
Esempio n. 6
0
 private void ShowWinner(GameManager.PlayerIndex obj)
 {
 }
Esempio n. 7
0
 public List <BlockController> GetPlayerBlocks(GameManager.PlayerIndex player)
 {
     return(PlayerBlocks[player]);
 }