private void OnTriggerExit2D(Collider2D other) { if (other.TryGetComponent <Boy>(out var player)) { _keyView.enabled = false; InputReciver.UnsubscribeOnInput <On_Button_Down>(StartDialog, KeyCode.E); } }
public override void DeInit() { base.DeInit(); InputReciver.UnsubscribeOnInputAxis(Move); if (IsOnStairs) { _transform.position = IsOnStairsTop ? _stairs.ExitTopPosition : _stairs.ExitBotPosition; } }
private void OnTriggerEnter2D(Collider2D other) { if (other.TryGetComponent <Boy>(out var player) && _currentDialog < _unlockedDialogs) { _player = player; InputReciver.SubscribeOnInput <On_Button_Down>(StartDialog, KeyCode.E); _keyView.enabled = true; } }
protected override void MyAwake() { _objects.AddRange(FindObjectsOfType <InteractObject>()); for (int i = 0; i < _objects.Count; i++) { _objects[i].Updated.Subscribe(OnUpdate, _observers); } InputReciver.SubscribeOnInput <On_Button_Down>(Interact, KeyCode.F, _observers); }
private void Unpause(On_Button_Down context) { if (_isPause == false) { return; } InputReciver.UnsubscribeOnInput <On_Button_Down>(Unpause, KeyCode.Escape); InputReciver.SubscribeOnInput <On_Button_Down>(SetPause, KeyCode.Escape); ChangePause(); }
protected override void AfterEnter() { base.AfterEnter(); InputReciver.SubscribeOnInputAxis(Move); _stairs = _executor.Stairs; if (IsOnStairs) { _transform.position = IsOnStairsTop ? _stairs.TopBound : _stairs.BotBound; } }
private void ExitDialog(On_Button_Down context) { IsTalk = false; InputReciver.UnsubscribeOnInput <On_Button_Down>(ExitDialog, KeyCode.E); InputReciver.SubscribeOnInput <On_Button_Down>(EnterDialog, KeyCode.E); }
public override void DeInit() { base.DeInit(); _animator.SetBool(_isMove, false); InputReciver.UnsubscribeOnInputAxis(Move); }
protected override void AfterEnter() { base.AfterEnter(); InputReciver.SubscribeOnInputAxis(Move); }
public DialogRequester(DialogSwitcher switcher) { _switcher = switcher; InputReciver.SubscribeOnInput <On_Button_Down>(RequestDialog, KeyCode.E, _observers); GameTime.SubscribeOnPause(context => _isPaused = context.IsPaused, _observers); }