private async void OnDestroy()
        {
            if (_socket != null)
            {
                await _socket.Close();
            }

            _isConnectedObserver?.Dispose();
            _serverJson?.Dispose();
            _reconnectObserver?.Dispose();
        }
Exemple #2
0
        /// <summary>
        /// Fsm 정지.
        /// </summary>
        public void StopFsm()
        {
            if (!_isRunned)
            {
                return;
            }

            _isRunned = false;
            _currentStateName?.Dispose();
            _stateNameDisposable?.Dispose();
            _cancellationTokenSource?.Cancel();
            _cancellationTokenSource?.Dispose();
            _fsmStateDict?.Clear();
            Debug.Log("stop fsm");
        }