public void gameButtonClick() { Debug.Log("gameButtonClicked: " + GameScript.gameState); switch (GameScript.gameState) { case GameScript.GameStates.sleeping: GameScript.spiderWakeUp(); gameText.text = "Scared?\nTap to block the spider"; endText.SetActive(false); GameScript.Instance.startLevel(1); break; case GameScript.GameStates.stopped: GameScript.spiderStartSleeping(); gameText.text = "Touch to wake up the spider"; break; case GameScript.GameStates.walking: if (GameScript.currentLevel < 5) { GameScript.createWall(); gameText.text = ""; } else { gameText.text = "Touch to restart"; endText.SetActive(true); GameScript.spiderStartSleeping(); GameScript.Instance.startLevel(6); } break; case GameScript.GameStates.dead: gameText.text = "Touch to wake up the spider"; GameScript.positionCameraAtStart(); GameScript.Instance.boot.SetActive(false); GameScript.spiderStartSleeping(); SpecialEffectsScript.PlaySleepingSound(); break; } }
// Use this for initialization void Start() { SpecialEffectsScript.PlaySleepingSound(); gameButton.SetActive(false); }