private void Awake()
        {
            // Init the MainThreadManager if it has not been already
            MainThreadManager.Create();

            // Store a reference to the Multiplayer menu
            mpMenu = this.GetComponentInParent <SteamworksMultiplayerMenu>();
            serverListEntryTemplateHeight = ((RectTransform)serverListEntryTemplate.transform).rect.height;

            // Disable the connect button until the user has selected a server
            connectButton.interactable = false;

            SteamMatchmaking.OnLobbyDataChanged  += OnLobbyDataUpdated;
            SteamMatchmaking.OnLobbyMemberJoined += OnLobbyMemberJoined;
            SteamMatchmaking.OnLobbyMemberLeave  += OnLobbyMemberLeave;

            // Request the initial lobby list
            GetAvailableLobbyList();
        }
Пример #2
0
        private void Awake()
        {
            // Init the MainThreadManager if it has not been already
            MainThreadManager.Create();

            // Store a reference to the Multiplayer menu
            mpMenu = this.GetComponentInParent <SteamworksMultiplayerMenu>();
            serverListEntryTemplateHeight = ((RectTransform)serverListEntryTemplate.transform).rect.height;

            // Disable the connect button until the user has selected a server
            connectButton.interactable = false;

            // Make sure steam callbacks are set
            callbackLobbyListRequest = Callback <LobbyMatchList_t> .Create(OnLobbyListRequested);

            callbackLobbyDataUpdate = Callback <LobbyDataUpdate_t> .Create(OnLobbyDataUpdated);

            // Request the initial lobby list
            GetAvailableLobbyList();
        }