示例#1
0
    public void CmdExitShop()
    {
        RpcDeactivateFinishedPlayer();
        AllPlayerManager.playerFinished(netId);

        if (AllPlayerManager.isPlayersToEndReached())  //???
        {
            StartCoroutine(ServerGM.finishLevel());
        }
    }
示例#2
0
    public void CmdExitLevel()
    {
        RpcKeyUsed();
        RpcDeactivateFinishedPlayer();

        AllPlayerManager.playerFinished(netId);

        if (AllPlayerManager.isPlayersToEndReached())  //end level
        {
            StartCoroutine(ServerGM.finishLevel());
        }
        else
        {
            StartCoroutine(ServerGM.givePlayerToObserve(this));
        }
    }
示例#3
0
    public static void handlePlayerDied(Player p)
    {
        AllPlayerManager.playerDied(p.netId);//update arrays; update player counts;

        allGMInst.RpcUpdatePlayerCountFrame(AllPlayerManager.playersActive, AllPlayerManager.playersFinished, AllPlayerManager.playersToNextLevel);
        if (AllPlayerManager.playersFinished + AllPlayerManager.playersActive > 0)
        {
            if (AllPlayerManager.isPlayersToEndReached())  //end level
            {
                instanceSelf.StartCoroutine(ServerGM.finishLevel());
            }
            else
            {
                instanceSelf.StartCoroutine(ServerGM.givePlayerToObserve(p));
            }
        }
        else  //game over
        {
            allGMInst.RpcFinishGame();
        }
    }