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 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; } }
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(); }
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 DialogRequester(DialogSwitcher switcher) { _switcher = switcher; InputReciver.SubscribeOnInput <On_Button_Down>(RequestDialog, KeyCode.E, _observers); GameTime.SubscribeOnPause(context => _isPaused = context.IsPaused, _observers); }