// Start is called before the first frame update void Start() { gameObject.AddComponent <AudioSource>().volume = Settings.EffectsVolume; auntie = null; StartCoroutine(AuntieCoroutine()); StartCoroutine(OrderCoroutine()); }
void GenerateAuntie(Difficulty stageDifficulty, Drink drink) { // Generate auntie flying text // Coroutine // Generate auntie 3s later auntie = Instantiate(auntiePrefab, new Vector3(10f, 0f, 0f), Quaternion.identity, transform).GetComponent <Auntie>(); auntie.Init(stageDifficulty, Random.Range(5, 10), drink); auntie.MoveTo(auntieDestination.transform.position); // Auntie is priority if (orders.Count > 0) { orders[0].SetSpeech(false); } }
public bool checkAndScoreDrink(Drink drink) { if (orders.Count == 0) { return(false); } Customer active = orders[0]; // Fill aunty's orders first!!!! if (auntie != null) { Debug.Log("Serve Auntie"); if (auntie.SubmitDrink(drink)) { Debug.Log("Serve Auntie CORRECT"); // SCORE! playClip(correctAudioClip); gameController.GetComponent <GameController>().AddScore((int)Mathf.Floor(auntie.timeRemaining)); auntie.angerLevel = 0; auntie.Leave(); auntie = null; // Render unker's orders active.SetSpeechVisible(true); return(true); } return(false); } if (active.SubmitDrink(drink)) { playClip(correctAudioClip); Difficulty difficulty = gameController.GetComponent <GameController>().difficulty; gameController.GetComponent <GameController>().AddScore((int)Mathf.Floor(active.timeRemaining)); gameController.GetComponent <GameController>().AddTime(difficulty.stageDifficulty); active.angerLevel = 0; active.Leave(); ProcessQueue(); return(true); } PlayIncorrectOrder(active); return(false); }
public object AddAuntie(Auntie auntie) { return DB.Insert(auntie); }