private void Awake() { _animator = GetComponent <Animator>(); _channel = new Channel("localhost:12345", ChannelCredentials.Insecure); _controller = StreamingHubClient.Connect <IUnityChanController, IUnityChanControllerReceiver>(this._channel, this); }
private async void OnDestroy() { await _controller?.UnregisterAsync(); await _controller?.DisposeAsync(); _controller = null; await _channel?.ShutdownAsync(); _channel = null; }
protected override async void OnClosed(EventArgs e) { base.OnClosed(e); (_unityLibrary as IDisposable)?.Dispose(); _unityLibrary = null; await _controller?.UnregisterAsync(); await _controller?.DisposeAsync(); _controller = null; await _channel?.ShutdownAsync(); }
public Form1() { InitializeComponent(); _channel = new Channel("localhost:12345", ChannelCredentials.Insecure); _controller = StreamingHubClient.Connect <IUnityChanController, IUnityChanControllerReceiver>(this._channel, this); }