Example #1
0
    void AddPlayers(bool challenge)
    {
        raceManager.ResetPlayers();

        if (challenge)
        {
            KeyCode[] keycodes = new KeyCode[4];
            keycodes[0] = KeyCode.UpArrow;

            if (!GA_Parameters.breakWithSpace)
            {
                keycodes[1] = KeyCode.DownArrow;
            }
            else
            {
                keycodes[1] = KeyCode.Space;
            }

            keycodes[2] = KeyCode.LeftArrow;
            keycodes[3] = KeyCode.RightArrow;
            raceManager.AddHumanPlayer("Me", keycodes);
        }

        for (int i = 0; i < activeNetworks.Count; i++)
        {
            raceManager.AddAIPlayer(i.ToString(), activeNetworks[i].CreateNetwork(), i);
        }

        raceManager.FinishPlayers(activeNetworks.Count);
    }