public void Awake() { if (Connection.isConnected == true) { Destroy(gameObject); return; } DontDestroyOnLoad(gameObject); Connection.Connect(IP, port); Manager.Connection.onData += OnDataRecieved; }
// Use this for initialization void Awake() { Configuration = m_Configuration; m_Connection = new DarkRiftConnection(); m_Connection.workInBackground = m_Configuration.NetworkingAsync; m_Connection.Connect(m_Configuration.ServerIP, m_Configuration.ServerPort); Debug.Log("Connected to Server!"); }
void Start() { //Connect to the server Connection.Connect(IP, port); }