コード例 #1
0
        private void HandleActions()
        {
            if (KeyBindings.GetKeyDown(Controls.Light) && Pointer.IsPointerOverUIObject() == false)
            {
                float timeClicked = Time.realtimeSinceStartup;
                if (Mathf.Abs(timeClicked - _timeClicked) < 0.4f)
                {
                    Destroy(gameObject);
                }
                else
                {
                    _timeClicked = timeClicked;
                }
            }

            if (((AbilityState.IsActive(Ability.Flash) && _fireplace == null) ||
                 (AbilityState.IsActive(Ability.Ignite) && _fireplace != null)) &&
                IsScouting == false)
            {
                if (KeyBindings.GetKeyDown(Controls.Light) && Pointer.IsPointerOverUIObject() == false)
                {
                    _burstTime += Time.deltaTime;
                }

                if (KeyBindings.GetKey(Controls.Light) && Pointer.IsPointerOverUIObject() == false)
                {
                    if (_burstTime > 0)
                    {
                        float maxTime = 2f;
                        _burstTime += Time.deltaTime;
                        _burstTime  = _burstTime > maxTime ? maxTime : _burstTime;
                        DecreaseVariables();
                    }
                }

                if (KeyBindings.GetKeyUp(Controls.Light))
                {
                    _burstTime = 0;
                    _controller.ResetVariables();
                    Burst();
                }
            }
            else
            {
                _burstTime = 0;
            }
        }
コード例 #2
0
        void Update()
        {
            SetBases();
            ResetTimeIfNotSpotted();
            _currentControl = BaseControl;
            UpdateStabilityIntensity();
            UpdateControlBorder();

            CurrentClimate.Stability = _currentStability;
            CurrentClimate.Intensity = _currentIntensity;
            CurrentClimate.Control   = _currentControl;

            if (KeyBindings.GetKeyUp(Controls.Ability1) && ChannelingHandler.ChannelingSet)
            {
                ChannelingHandler.IsTethered = !ChannelingHandler.IsTethered;
            }
        }