using System.Collections;
using TNet;
using UnityEngine;
[RequireComponent
(typeof(TNTcpLobbyClient
))] public class demo : MonoBehaviour
{
public string remoteAddress = "192.168.1.102";
public int remotePort = 10421;
private TNTcpLobbyClient tcplobbyclient;
private void OnEnable()
{
TNLobbyClient.onChange += OnChange_List;
}
private void OnDisable()
{
TNLobbyClient.onChange -= OnChange_List;
}
private void Awake()
{
tcplobbyclient = GetComponent<TNTcpLobbyClient>();
tcplobbyclient.remoteAddress = remoteAddress;
tcplobbyclient.remotePort = remotePort;
}
private IEnumerator Start()
{
while (TNManager.isJoiningChannel) yield return null;
//wait until ready to use
tcplobbyclient.enabled = true;
}
private void OnChange_List()
{
Debug.Log("OnChange_List");
}
}