private void StopChopCoroutine() { OnChoppingStop?.Invoke(LastPlayerControllerInteracting); _isChopping = false; if (_chopCoroutine != null) { StopCoroutine(_chopCoroutine); } }
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); }