private void EventNodeClick() { ns.nextLevel(); EventUICanvas.alpha = 0; EventUICanvas.gameObject.SetActive(true); StartCoroutine(EventUIFadeIn()); }
private void ShopNodeClick() { ns.nextLevel(); ShopUICanvas.alpha = 0; ShopUICanvas.gameObject.SetActive(true); StartCoroutine(ShopUIFadeIn()); }
private void RestNodeClick() { ns.nextLevel(); RestUICanvas.alpha = 0; RestUICanvas.gameObject.SetActive(true); ConsistentObj.setHealth(10); StartCoroutine(RestUIFadeIn()); }
private void CheckAnswer(int i) { if (!disable) { if (i == correctAnswer) { //correct enemyHealth -= 5; EnemyHealth.text = "Enemy:\n" + enemyHealth.ToString(); } else { //wrong ConsistentObj.setHealth(ConsistentObj.getHealth() - 5); Health.text = "Health:\n" + ConsistentObj.getHealth().ToString(); } if (ConsistentObj.getHealth() <= 0) { disable = true; //gameover GameOverLabel.SetActive(true); StartCoroutine(GameOverFade()); } else if (enemyHealth <= 0) { disable = true; //win VictoryLabel.SetActive(true); ns.nextLevel(); StartCoroutine(VictoryFade()); } else { GenerateQuestion(); } } }