Beispiel #1
0
 public void ButtonDown()
 {
     manualDropTimer -= 1.0f * Time.deltaTime;
     if (manualDropTimer <= 0)
     {
         dropTimer       = dropDelay.Value;
         manualDropTimer = manualDropDelay.Value;
         if (droppable.CanDrop())
         {
             droppable.Drop();
         }
         else
         {
             OnInactive?.Invoke();
         }
     }
 }
Beispiel #2
0
        public IEnumerator DropCoroutine()
        {
            while (canControl)
            {
                if (dropTimer <= 0)
                {
                    if (droppable.CanDrop())
                    {
                        this.droppable.Drop();
                    }
                    else
                    {
                        OnInactive?.Invoke();
                    }
                    dropTimer = dropDelay.Value;
                }

                dropTimer -= Time.deltaTime;
                yield return(null);
            }
        }