Пример #1
0
    private void Awake()
    {
        _animator = GetComponent <Animator>();

        _channel    = new Channel("localhost:12345", ChannelCredentials.Insecure);
        _controller = StreamingHubClient.Connect <IUnityChanController, IUnityChanControllerReceiver>(this._channel, this);
    }
Пример #2
0
    private async void OnDestroy()
    {
        await _controller?.UnregisterAsync();

        await _controller?.DisposeAsync();

        _controller = null;
        await _channel?.ShutdownAsync();

        _channel = null;
    }
Пример #3
0
        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();
        }
Пример #4
0
 public Form1()
 {
     InitializeComponent();
     _channel    = new Channel("localhost:12345", ChannelCredentials.Insecure);
     _controller = StreamingHubClient.Connect <IUnityChanController, IUnityChanControllerReceiver>(this._channel, this);
 }