コード例 #1
0
 private bool TryChannel()
 {
     if (ChannelingHandler.ChannelingSet == false &&
         ChannelingHandler.IsChanneling == false &&
         KeyBindings.GetKeyDown(Controls.Light) &&
         Pointer.IsPointerOverUIObject() == false)
     {
         ChannelingHandler.StartChanneling();
         Anim.PlayAnimation(Animations.CreatePL);
         return(true);
     }
     return(false);
 }
コード例 #2
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;
            }
        }