예제 #1
0
    public void DEVTOOLprevPlayer(PlayerMovement currentPlayer)
    {
        print("prev player request");

        bool switchedPlayer = false;
        int prevPlayerNum = currentPlayer.GetPlayerNum() - 1;

        do
        {
            if (prevPlayerNum < 1)
                prevPlayerNum = playerMovers.Count;

            if (!playerMovers[prevPlayerNum - 1].isControllerConnected())
            {
                int temp = playerMovers[prevPlayerNum - 1].GetPlayerNum();
                playerMovers[prevPlayerNum - 1].SetPlayer(currentPlayer.GetPlayerNum(), developerModeOn);
                currentPlayer.SetPlayer(temp, developerModeOn);
                switchedPlayer = true;
                break;
            }

            prevPlayerNum--;
        }
        while (!switchedPlayer);
    }
예제 #2
0
    public void DEVTOOLnextPlayer(PlayerMovement currentPlayer)
    {
        print("next player request");

        bool switchedPlayer = false;
        int nextPlayerNum = currentPlayer.GetPlayerNum() + 1;

        do
        {
            if (nextPlayerNum > playerMovers.Count)
                nextPlayerNum = 1;

            if (!playerMovers[nextPlayerNum - 1].isControllerConnected())
            {
                int temp = playerMovers[nextPlayerNum - 1].GetPlayerNum();
                playerMovers[nextPlayerNum - 1].SetPlayer(currentPlayer.GetPlayerNum(), developerModeOn);
                currentPlayer.SetPlayer(temp, developerModeOn);
                switchedPlayer = true;
                break;
            }

            nextPlayerNum++;
        }
        while (!switchedPlayer);
    }