public void pause() { currentTime = lastTime; currentInstant = Instant.Pause; currentAddingInstant = AddingInstant.Pause; canPause = false; canPlay = true; canStop = true; canExit = false; StopCoroutine(cook()); refresh(); }
public int getVolumeInProcess(InteractableObject ingredient, AddingInstant instant) { int count = 0; foreach (Process p in process) { if (p.frag.ingredient == ingredient && p.instantAdded == instant) { count++; } } return(count); }
public void play() { currentInstant = Instant.While; currentAddingInstant = AddingInstant.While; alreadyStarted = true; consumeIngredients(); canPlay = false; canPause = true; canStop = true; canExit = false; if (resultState == 3) { setResultDescriptionAsRecipesList(); } StartCoroutine(cook()); refresh(); }
public void stop() { result = getResult(); currentTime = lastTime; currentTime = 0; slotsUsed = 0; layout.time.text = Mathf.Round(currentTime).ToString("F0"); currentInstant = Instant.After; currentAddingInstant = AddingInstant.Before; alreadyStarted = false; canStop = false; canPlay = true; canPause = false; canExit = true; StopCoroutine(cook()); ingredientsIn.Clear(); process.Clear(); beforeProcess.Clear(); whileProcess.Clear(); pauseProcess.Clear(); refresh(); }
public void initialize(Recipient r) { GameState.Instance.ChangeCurrentState(GameState.GameStates.crafting); fillPlayerIngredients(); fillRecipes(); alreadyStarted = false; currentInstant = Instant.Before; currentAddingInstant = AddingInstant.Before; isCrafting = false; craftingTime = 0; slotsUsed = 0; totalPages = getIngredientsPages(); currentPage = 1; currentRecipient = r; slots = currentRecipient.slots; process = new List <Process>(); beforeProcess = new List <Process>(); pauseProcess = new List <Process>(); whileProcess = new List <Process>(); currentTime = 0; result = null; canPlay = true; canPause = false; canStop = false; canExit = true; ingredientsIn = new List <frag>(); resultState = 0; //0-> Recetas, 1->Descripción, 2->Resultado, 3->Resultado Fallido. GameObject newCraft = Instantiate(craftLayout, contentContainer); layout = newCraft.GetComponent <CraftingLayout>(); initLayout(); }