Esempio n. 1
0
        public override void TrackThumbStickAxis(Vector2 axis)
        {
            if (axis.x >= _turnAxisAmount && _lastTurnDirection == WrenchDirection.Left)
            {
                _lastTurnDirection = WrenchDirection.Right;
                HoldingPlayer.ToolBubble.ShowThumbLeft();

                _turnEffectTrigger.Trigger();
            }
            else if (axis.x <= -_turnAxisAmount && _lastTurnDirection == WrenchDirection.Right)
            {
                _lastTurnDirection = WrenchDirection.Left;
                HoldingPlayer.ToolBubble.ShowThumbRight();

                _turnEffectTrigger.Trigger();

                _successfulTurns++;
            }

            if (_successfulTurns >= GameManager.Instance.GameGameData.WrenchSuccessfulTurns)
            {
                if (!RepairPoint.IsRepaired)
                {
                    RepairPoint.Repair();
                }
            }
        }
Esempio n. 2
0
        protected override void Awake()
        {
            base.Awake();

            _holdTimer = TimeManager.Instance.AddTimer();
            _holdTimer.TimesUpEvent += (sender, args) => {
                if (!RepairPoint.IsRepaired)
                {
                    RepairPoint.Repair();
                }
            };
        }
Esempio n. 3
0
        protected override void OnUseToolEffectEnd()
        {
            base.OnUseToolEffectEnd();

            base.EndUse();

            HoldingPlayer.ToolBubble.ShowUnpressedButton();

            _succesfulHits++;
            if (_succesfulHits < GameManager.Instance.GameGameData.HammerSuccessfulHits)
            {
                return;
            }

            if (!RepairPoint.IsRepaired)
            {
                RepairPoint.Repair();
            }
        }