private void Update()
        {
            _currentStateTime -= Time.deltaTime;

            foreach (var enterPoint in EnterPoints)
            {
                enterPoint.enabled = State == TrainMovingState.Waiting;
            }

            switch (State)
            {
            case TrainMovingState.Hidden:
                TrainObject.SetActive(false);

                break;

            case TrainMovingState.MoveIn:
                TrainObject.transform.localPosition = new Vector3(0, 0, Mathf.Lerp(MaxZ, MinZ, (_currentStateTime / MoveInDuration) * (_currentStateTime / MoveInDuration)));
                TrainObject.SetActive(true);

                if (_currentStateTime <= 0)
                {
                    State = TrainMovingState.Waiting;
                    OnWaitingStarted?.Invoke();
                }

                break;

            case TrainMovingState.Waiting:
                TrainObject.transform.localPosition = Vector3.zero;
                TrainObject.SetActive(true);

                break;

            case TrainMovingState.MoveOut:
                float t = _currentStateTime / MoveOutDuration;
                TrainObject.transform.localPosition = new Vector3(0, 0, Mathf.Lerp(MinZ, MaxZ, (_currentStateTime / MoveOutDuration) * (_currentStateTime / MoveOutDuration)));
                TrainObject.SetActive(true);

                if (_currentStateTime <= 0)
                {
                    State = TrainMovingState.Hidden;
                }

                break;
            }

            RaiseEvents();
            _prevState = State;

            CountText.text = $"{Passengers} / {MaxPassengers}";
        }
 public void MoveOut()
 {
     State             = TrainMovingState.MoveOut;
     _currentStateTime = MoveOutDuration;
 }
 public void MoveIn()
 {
     gameObject.SetActive(true);
     State             = TrainMovingState.MoveIn;
     _currentStateTime = MoveInDuration;
 }