Esempio n. 1
0
 private void OnTriggerExit2D(Collider2D other)
 {
     if (other.TryGetComponent <Boy>(out var player))
     {
         _keyView.enabled = false;
         InputReciver.UnsubscribeOnInput <On_Button_Down>(StartDialog, KeyCode.E);
     }
 }
Esempio n. 2
0
 public override void DeInit()
 {
     base.DeInit();
     InputReciver.UnsubscribeOnInputAxis(Move);
     if (IsOnStairs)
     {
         _transform.position = IsOnStairsTop ? _stairs.ExitTopPosition : _stairs.ExitBotPosition;
     }
 }
Esempio n. 3
0
 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;
     }
 }
Esempio n. 4
0
 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);
 }
Esempio n. 5
0
 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();
 }
Esempio n. 6
0
 protected override void AfterEnter()
 {
     base.AfterEnter();
     InputReciver.SubscribeOnInputAxis(Move);
     _stairs = _executor.Stairs;
     if (IsOnStairs)
     {
         _transform.position = IsOnStairsTop ? _stairs.TopBound : _stairs.BotBound;
     }
 }
Esempio n. 7
0
 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);
 }
Esempio n. 8
0
 public override void DeInit()
 {
     base.DeInit();
     _animator.SetBool(_isMove, false);
     InputReciver.UnsubscribeOnInputAxis(Move);
 }
Esempio n. 9
0
 protected override void AfterEnter()
 {
     base.AfterEnter();
     InputReciver.SubscribeOnInputAxis(Move);
 }
Esempio n. 10
0
 public DialogRequester(DialogSwitcher switcher)
 {
     _switcher = switcher;
     InputReciver.SubscribeOnInput <On_Button_Down>(RequestDialog, KeyCode.E, _observers);
     GameTime.SubscribeOnPause(context => _isPaused = context.IsPaused, _observers);
 }