Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- using UnityEngine.Networking.Match;
- using UnityEngine.Networking;
- using Steamworks;
- using System;
- [RequireComponent(typeof(TextMesh))]
- public class SelectableMatch : Selectable {
- CSteamID _joinThis;
- public CSteamID JoinThis {
- set {
- if(SteamManager.Initialized) {
- var text = GetComponent<TextMesh>();
- text.text = SteamMatchmaking.GetLobbyData(value, "name");
- _joinThis = value;
- }
- }
- get {
- return _joinThis;
- }
- }
- public NATTraversal.NetworkManager manager;
- // Use this for initialization
- void Start () {
- }
- // Update is called once per frame
- void Update () {
- }
- public override void OnSelect() {
- print("Selected!");
- print(JoinThis);
- if(SteamManager.Initialized) {
- print("Joining: " + SteamMatchmaking.GetLobbyData(JoinThis, "name") + " at " + SteamMatchmaking.GetLobbyData(JoinThis, "publicIP"));
- manager.StartClientAll(SteamMatchmaking.GetLobbyData(JoinThis, "publicIP"),
- SteamMatchmaking.GetLobbyData(JoinThis, "internalIP"),
- Convert.ToUInt64(SteamMatchmaking.GetLobbyData(JoinThis, "guid")));
- //manager.StartClient();
- }
- }
- }
Add Comment
Please, Sign In to add comment