Exemplo n.º 1
0
    public IEnumerator Cook()
    {
        float journey = 0f;

        while (journey <= duration)
        {
            journey      += Time.deltaTime;
            percentCooked = Mathf.Clamp01(journey / duration);

            ingCookValue = Mathf.Lerp(0, 1.0f, percentCooked);
            if (ingCookValue > 0.99f)
            {
                stateIngredient = StateIngredient.cooked;
            }

            yield return(null);
        }
    }
Exemplo n.º 2
0
 private void OnEnable()
 {
     stateIngredient = StateIngredient.raw;
 }