protected override void PostConstruct() { base.PostConstruct(); if (PauseWhenVisible) { Node.GetTree().Paused = true; } else { _initialActiveState = PlayerControl.Active; PlayerControl.Active = false; } Input.SetMouseMode(Input.MouseMode.Visible); CloseAction.Iter(action => { Node.OnUnhandledInput() .Where(e => e.IsActionPressed(action) && !e.IsEcho()) .Do(_ => Node.GetTree().SetInputAsHandled()) .TakeUntil(Disposed.Where(identity)) .Subscribe(_ => Resume(), this); }); }