Ejemplo n.º 1
0
 private void StopChopCoroutine()
 {
     OnChoppingStop?.Invoke(LastPlayerControllerInteracting);
     _isChopping = false;
     if (_chopCoroutine != null)
     {
         StopCoroutine(_chopCoroutine);
     }
 }
Ejemplo n.º 2
0
        private IEnumerator Chop()
        {
            _isChopping = true;
            while (_currentProcessTime < _finalProcessTime)
            {
                slider.value         = _currentProcessTime / _finalProcessTime;
                _currentProcessTime += Time.deltaTime;
                yield return(null);
            }

            // finished
            _ingredient.ChangeToProcessed();
            slider.gameObject.SetActive(false);
            _isChopping    = false;
            _chopCoroutine = null;
            OnChoppingStop?.Invoke(LastPlayerControllerInteracting);
        }