public void Clear() { GlassFill glass = FindObjectOfType <GlassFill>(); glass.clearIngredients(); foreach (GameObject t in glass.toppings) { Destroy(t); } glass.toppings.Clear(); if (MonsterSpawner.inTutorial && !clearButtonEnabled) { YarnBarTending.EnableDialogueFunctions(); clearButtonEnabled = true; } }
// functions for all the ways in which the player can change the monster's happiness // correctness is a float from 0.0 to 1.0, where 0.0 is totally wrong and 1.0 is totally correct public void GivenDrink(float correctness) { int change = (int)Mathf.Round(4 * (correctness - 0.5f)); //Debug.Log("correctness = " + correctness + ", change = " + change); happiness += change; prefab.GetComponent <Monster>().happiness = happiness; // update the prefab's data // hide the drink icon GameObject.Find("Dialogue System").GetComponent <DialoguePositionTracker>().HideDialogueSystem(); if (MonsterSpawner.inTutorial) { YarnBarTending.EnableDialogueFunctions(); } hasDrink = true; }
public void OnMouseUp() { if (equipIngredient.equippedObject != null) { AddIngredient(equipIngredient.equippedObject); if (MonsterSpawner.inTutorial && (!YarnBarTending.multipleIngredients || (currentDrink.GetAmount() == 4 && dataStorage.currentDay == 0) || (currentDrink.GetAmount() == 3 && dataStorage.currentDay == 1) || (currentDrink.GetAmount() == 3 && dataStorage.currentDay == 2))) { equipIngredient.equippedObject.GetComponent <HoverHighlight>().isEnabled = false; equipIngredient.equippedObject.GetComponent <ClickIngredient>().isEnabled = false; equipIngredient.ClickOnObject(equipIngredient.equippedObject); YarnBarTending.EnableDialogueFunctions(); YarnBarTending.multipleIngredients = false; } } }
private void StopBlending() { blending = false; // teleport cup back to center glassMove.gameObject.transform.position = new Vector3(glassXPosition, glassYPosition, 0); // blend drink glassFill.currentDrink.BlendToppings(); // update sprite glassFill.UpdateDrinkSprite(false); // stop sound mixSound.Stop(); // if in tutorial, then reenable dialogue functions if (MonsterSpawner.inTutorial && YarnBarTending.readyToBlend) { YarnBarTending.EnableDialogueFunctions(); YarnBarTending.readyToBlend = false; GlassMove.cupCanMove = false; } }
public void OnMouseDown() { if (inAfterHours || inEnding) { return; } if (alreadyClickedOn || Monster.currentlyOrdering) { return; } alreadyClickedOn = true; Monster.currentlyOrdering = true; Monster.currentlyOrderingMonster = this; FindObjectOfType <Yarn.Unity.DialogueRunner>().StartDialogue(dialogueToStart + (dataStorage.currentDay + 1)); // remove hover highlight Destroy(GetComponent <HoverHighlight>()); Destroy(GetComponent <Light2D>()); // activate dialogue system string currentSeatName = ""; if (seat.seatLocation.x < 0) { currentSeatName = "leftSeat"; } else if (seat.seatLocation.x > 0) { currentSeatName = "rightSeat"; } else if (seat.seatLocation.x == 0) { currentSeatName = "centerSeat"; } DialoguePositionTracker dialogueSystem = GameObject.Find("Dialogue System").GetComponent <DialoguePositionTracker>(); dialogueSystem.SetDialoguePosition(currentSeatName); dialogueSystem.SetDrinkIconColor(recipeManager.GetDrinkByName(drinkOrder).GetDisplayColor()); // update order notes recipeSheet.AddOrderNotes(drinkOrder, orderNotes); // Increase happiness if clicked within first 15 s of sitting down if (seatTimer <= 15.0f) { happiness += 1; } GameObject.Find("CloseBarButton").GetComponent <Button>().interactable = false; if (MonsterSpawner.inTutorial) { MonsterSpawner.SkipTutorialButton.SetActive(true); } if (!MonsterSpawner.inTutorial && MonsterSpawner.tutorialJustEnded) { YarnBarTending.instance = gameObject.GetComponent <YarnBarTending>(); YarnBarTending.EnableDialogueFunctions(); MonsterSpawner.tutorialJustEnded = false; } }