IEnumerator FreezeForSomeCooldown(float cooldown) { float internalCdw = 0f; _movementMouseComponent.Animator_CantMove(); while (internalCdw <= cooldown) { internalCdw += Time.deltaTime; yield return(new WaitForFixedUpdate()); } _movementMouseComponent.Animator_CanMove(); }
private void ManageTheButHole() { if (_inputManager.PoopButton == 1 && !_isPooping && StomachItemList.Any(e => e.State == EnumStomachItemDTOState.ReadyToPoop) && _playerStructure.PoopAmout < _maximumAmoutOfPoop) { _movementMouseComponent.Animator_CantMove(); _isPooping = true; List <StomachItemDTO> foodToPoopList = StomachItemList.Where(e => e.State == EnumStomachItemDTOState.ReadyToPoop).ToList(); string currentFlowersRecipeInStomach = string.Join("-", foodToPoopList.Select(e => e.Item.GetHashCode()).OrderBy(e => e).ToList()); _currentPoop = _poopList.FirstOrDefault(e => e.Recipe == currentFlowersRecipeInStomach); _animator.SetTrigger(_animatorVariables.Poop); List <Guid> foodToPoopIdList = foodToPoopList.Select(e => e.Id).ToList(); StomachItemList.RemoveAll(e => foodToPoopIdList.Contains(e.Id)); _stomachUIComponent.RemoveFoods(foodToPoopIdList); _playerStructure.PoopAmout++; } }