コード例 #1
0
    public void RpcStartGame(int s)
    {
        songID            = s;
        scored_ThisRound  = 0;
        scored_TimeBonus  = 0;
        scored_FirstBonus = false;
        scored_WasGuessed = false;

        //playerParent.GetComponent<PlayerParentScript>().Unlock();

        // Bullshit code. Temp? Maybe not?
        // What if player WAS ready, but now that we're actually starting they are no longer?
        // Too late for them! Let's double check
        if (!ready)
        {
            Assert.IsFalse(ready, "Player wasn't ready, but the server thought they were!");
            // Oh noes! What do we do? Let's cheat:
            SetReady(true);
            // See buddy, you were ready the whole time, right?
        }
        ResetMatch();

        if (isLocalPlayer)
        {
            GUIManagerScript.SetButton(false);

            GUIManagerScript.SetBackButton(false);

            Color clr = ColorScript.GetColor(GetColor());
            clr = clr * 0.5f;
            GUIManagerScript.SetNumberInputFieldColor(clr);
            GUIManagerScript.ClearNumberInput();
            GUIManagerScript.SetSongSetButton(false);

            //Hacky bullshit for finding which kind of game we're in?
            GameManagerScript gameManager = FindObjectOfType <GameManagerScript>();
            Assert.IsNotNull <GameManagerScript>(gameManager);
            int index = gameManager.GetSongSet();

            AudioManagerScript.instance.StartGameMusic(index);

            GUIManagerScript.SetClassicGameParent(color, ColorScript.GetColor(color), ColorScript.GetColorName(color));

            localPScript.reminded = false;
        }

        List <CaptainsMessPlayer> players = GetPlayers();

        foreach (CaptainsMessPlayer player in players)
        {
            NetworkedPlayerScript nps = player.GetComponent <NetworkedPlayerScript>();
            if (!nps.isLocalPlayer)
            {
                player.GetComponent <NetworkedPlayerScript>().playerButton.SetActive(true);
                player.GetComponent <NetworkedPlayerScript>().playerButton.GetComponent <Button>().interactable = true;
            }
        }
    }