Example #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);
     }
 }
Example #2
0
 public override void DeInit()
 {
     base.DeInit();
     InputReciver.UnsubscribeOnInputAxis(Move);
     if (IsOnStairs)
     {
         _transform.position = IsOnStairsTop ? _stairs.ExitTopPosition : _stairs.ExitBotPosition;
     }
 }
Example #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;
     }
 }
Example #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);
 }
Example #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();
 }
Example #6
0
 protected override void AfterEnter()
 {
     base.AfterEnter();
     InputReciver.SubscribeOnInputAxis(Move);
     _stairs = _executor.Stairs;
     if (IsOnStairs)
     {
         _transform.position = IsOnStairsTop ? _stairs.TopBound : _stairs.BotBound;
     }
 }
Example #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);
 }
Example #8
0
 public override void DeInit()
 {
     base.DeInit();
     _animator.SetBool(_isMove, false);
     InputReciver.UnsubscribeOnInputAxis(Move);
 }
Example #9
0
 protected override void AfterEnter()
 {
     base.AfterEnter();
     InputReciver.SubscribeOnInputAxis(Move);
 }
Example #10
0
 public DialogRequester(DialogSwitcher switcher)
 {
     _switcher = switcher;
     InputReciver.SubscribeOnInput <On_Button_Down>(RequestDialog, KeyCode.E, _observers);
     GameTime.SubscribeOnPause(context => _isPaused = context.IsPaused, _observers);
 }