void OnMouseDown() { if (EmotionsGameManager.inputAllowed && (EmotionsGameManager.GetInstance().isTutorialRunning || EmotionsGameManager.GetInstance().gameStarted)) { EmotionsGameManager.GetInstance().CheckEmotion(this.gameObject); EmotionsGameManager.GetInstance().subtitlePanel.GetComponent <SubtitlePanel> ().Display(emotions.ToString(), this.clipOfName); } }
public void Display(string subtitle, AudioClip clip = null, bool queue = false) { if (!gameObject.activeSelf) { gameObject.SetActive(true); } if (sub == null) { sub = new Subtitle(); } if (!queue || !isDisplaying) { isDisplaying = true; sub.Display(gameObject, textComp, subtitle, clip); if (EmotionsGameManager.GetInstance()) { StartCoroutine(WaitTillHide(EmotionsGameManager.GetInstance().waitDuration)); } else if (BMaze_Manager.GetInstance()) { StartCoroutine(WaitTillHide(2f)); } /* * else if (MemoryMatchGameManager.GetInstance ()) { * StopCoroutine (WaitTillHide(3f)); * StartCoroutine (WaitTillHide (3f)); * } */ } else { Tuple <string, AudioClip> t = new Tuple <string, AudioClip>(subtitle, clip); displayQueue.Enqueue(t); t.ToString(); } }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } if (!GameManager.GetInstance()) { SwitchScene switchScene = this.gameObject.AddComponent <SwitchScene> (); switchScene.loadScene("Start"); } else { tutorialCanvas.gameObject.SetActive(false); tutorialHand.SetActive(false); secondaryEmotions = new List <GameObject> (); // Checks if game manager exists, if not default values are chosen if (GameManager.GetInstance()) { monsterType = GameManager.GetMonsterType(); if (monsterType == GameManager.MonsterType.Blue) { primaryEmotions = blueEmotions; } else { secondaryEmotions.AddRange(blueEmotions); } if (monsterType == GameManager.MonsterType.Green) { primaryEmotions = greenEmotions; } else { secondaryEmotions.AddRange(greenEmotions); } if (monsterType == GameManager.MonsterType.Red) { primaryEmotions = redEmotions; } else { secondaryEmotions.AddRange(redEmotions); } if (monsterType == GameManager.MonsterType.Yellow) { primaryEmotions = yellowEmotions; } else { secondaryEmotions.AddRange(yellowEmotions); } difficultyLevel = GameManager.GetInstance().GetLevel("MonsterEmotions"); } else { monsterType = GameManager.GetMonsterType(); primaryEmotions = greenEmotions; secondaryEmotions.AddRange(blueEmotions); secondaryEmotions.AddRange(redEmotions); secondaryEmotions.AddRange(yellowEmotions); difficultyLevel = 1; } emotionsSetup = new Dictionary <int, Tuple <int, int> > () { { 1, new Tuple <int, int> (2, 0) }, { 2, new Tuple <int, int> (3, 0) }, { 3, new Tuple <int, int> (4, 0) }, { 4, new Tuple <int, int> (3, 1) }, { 5, new Tuple <int, int> (2, 2) } }; if (GameManager.GetInstance().LagoonTutorial [(int)Constants.BrainstormLagoonLevels.EMOTIONS]) { tutorialCoroutine = StartCoroutine(RunTutorial()); } else { PregameSetup(); } } }