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(); } } }
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); } }