void Start()
 {
     serviceSceneTransition = GetComponent <ServiceSceneTransition>();
     serviceScoreRegister   = GetComponent <ServiceScoreRegister>();
     GameObject.Find("/Canvas/BtnReplay").GetComponent <Button>().onClick.AddListener(serviceSceneTransition.goToSceneGamePlay);
     GameObject.Find("/Canvas/BtnQuitGameMenu").GetComponent <Button>().onClick.AddListener(serviceSceneTransition.goToSceneGameMenu);
     GameObject.Find("/Canvas/TextScore").GetComponent <Text>().text = "Pontuação: " + serviceScoreRegister.printScore();
 }
 // Start is called before the first frame update
 void Start()
 {
     serviceGameMaster      = GetComponent <ServiceGameMaster>();
     serviceSceneTransition = GetComponent <ServiceSceneTransition>();
     serviceScoreRegister   = GetComponent <ServiceScoreRegister>();
     GameObject.Find("/Canvas/CanvasPaused/BtnPlay").GetComponent <Button>().onClick.AddListener(serviceGameMaster.pauseGame);
     GameObject.Find("/Canvas/CanvasPaused/BtnReplay").GetComponent <Button>().onClick.AddListener(serviceSceneTransition.goToSceneGamePlay);
     GameObject.Find("/Canvas/CanvasPaused/BtnQuitGameMenu").GetComponent <Button>().onClick.AddListener(serviceSceneTransition.goToSceneGameMenu);
     GameObject.Find("/Canvas/BtnPause").GetComponent <Button>().onClick.AddListener(serviceGameMaster.pauseGame);
 }
예제 #3
0
 void Start()
 {
     gameMaster             = GetComponent <GameMaster>();
     serviceScoreRegister   = GetComponent <ServiceScoreRegister>();
     serviceShip            = GameObject.Find("Ship").GetComponent <ServiceShip>();
     serviceSceneTransition = GetComponent <ServiceSceneTransition>();
     serviceAsteroid        = prefabAsteroid.GetComponent <ServiceAsteroid>();
     initiateNewGame();
     initialAsteroidWave();
     StartCoroutine("normalAsteroidWave");
     StartCoroutine("specialAsteroidWave");
     StartCoroutine("updateScore");
     StartCoroutine("updateGameTime");
 }