public int[] dropRadius;         // The various maximum distance the pickups can drop in

    private void Start()
    {
        foreach (Code_PickUp p in pickUps)
        {
            p.pickUpMng = this;
        }
        pooledCount = pickUps.Length;
        arena       = gameMng.arena;
        StartDropProcess();
    }
    // Resets the pickUps Array when the game/match resets
    public void ResetPickUps()
    {
        // Repool any unpooled members of the pickUps array
        foreach (Code_PickUp p in pickUps)
        {
            if (p.isUnpooled)
            {
                p.PoolPickUp();
            }
        }

        // Assign a new arena based on the gameMngers
        arena = gameMng.arena;
    }
Example #3
0
    // Restarts when the game with the same amount of players
    public void RestartWithSameNumbers()
    {
        // turn off the playagain menu
        ingameMng.playAgain.SetActive(!ingameMng.playAgain.activeSelf);

        // Set all players to non-active
        FillActivePlayerList();

        // Destroy the arena
        Destroy(arena.gameObject);

        // Instantiate the new one
        newArena      = Instantiate(arenaPrefab, Vector3.zero, Quaternion.identity);
        newArena.name = arenaName;
        arena         = newArena.GetComponent <Code_Arena>();

        // Assign a new bouncer to the arena
        arena.bouncer = bouncer;
        // Reset the bouncers position
        bouncer.ResetPosition();

        // Reset the pickUpMng
        pickUpMng.ResetPickUps();

        // Reset firstTimeStarting
        firstTimeStarting = false;

        // Reset player stamina if necesarry
        foreach (GameObject player in activePlayers)
        {
            player.GetComponent <Code_Player>().ResetPlayer();
        }

        // Reset the Camera bonus
        camCon.UpdateBonuses(-1); // The UpdateBonusses itself increments the int value with 1

        // Resets the camera to it's origin position
        camCon.ResetCamera();

        // Call SpawnPlayers
        SpawnPlayers();
    }