public void Connect(System.Net.IPAddress ipAddress, int port) { if (!IsConnected) { if (_client == null) { Initalize(); } StartedConnection?.Invoke(); Action updateAction = _client.Connect(ipAddress, port); if (_updater == null) { GameObject updaterInstance = Instantiate(_updaterPrefab); DontDestroyOnLoad(updaterInstance); _updater = updaterInstance.GetComponent <FixedUpdater>(); } _updater.UpdateAction = updateAction; _updater.enabled = true; //start listening for } }
public static void OnClose(this ProtectionResult result, StartedConnection connection, Action <string> action) => connection.On(result.OnClose, action);
public static void OnLog(this StartedConnection connection, string id, Action <string, string, string> action) => connection.On(id, action);
public static void OnSuccess(this ProtectionResult result, StartedConnection connection, Action <ProtectedApplicationDto> action) => connection.On(result.OnSuccess, action);