示例#1
0
    public void RestartGame(bool masterclientSwitched, bool restartManually)
    {
        if (gameTimesUp || logic.Restarting)
        {
            return;
        }

        GameModes.OnRestart();
        checkpoint          = null;
        logic.Restarting    = true;
        logic.RoundTime     = 0f;
        logic.MyRespawnTime = 0f;
        foreach (var info in killInfoList)
        {
            info.destroy();
        }

        killInfoList.Clear();
        racingResult = new ArrayList();
        RCManager.ClearVariables();
        ShowHUDInfoCenter(string.Empty);
        DestroyAllExistingCloths();
        GameModes.SendRpc();
        PhotonNetwork.DestroyAll();
        BasePV.RPC("RPCLoadLevel", PhotonTargets.All);
        if (masterclientSwitched)
        {
            SendChatContentInfo(User.MasterClientSwitch);
        }
        else
        {
            if (!restartManually && User.MsgRestart.Length > 0)
            {
                SendChatContentInfo(User.MsgRestart);
            }
        }
    }