Example #1
0
 public float cortar()
 {
     if (progresoCortado < duracion)
     {
         progresoCortado += Time.deltaTime;
         return(progresoCortado);
     }
     else
     {
         progresoCortado = duracion;
         estado          = IngredienteEstado.Cortado;
         //cargar modelo cortado.
         rawModel.SetActive(false);
         cortadoModel.SetActive(true);
         Debug.Log(progresoCortado);
         return(progresoCortado);
     }
 }
Example #2
0
    void Start()
    {
        estado          = IngredienteEstado.Normal;
        duracion        = 3f;
        progresoCortado = 0f;

        rawModel     = this.gameObject.transform.GetChild(0).gameObject;
        cortadoModel = this.gameObject.transform.GetChild(1).gameObject;
        if (this.gameObject.name.Contains("tomate"))
        {
            tipoIng = tipoIngrediente.Tomate;
        }
        else if (this.gameObject.name.Contains("champ"))
        {
            tipoIng = tipoIngrediente.Mushroom;
        }
        else
        {
            tipoIng = tipoIngrediente.Cebolla;
        }
    }