Ejemplo n.º 1
0
 void Start()
 {
     // score set up
     scoreUI      = GameObject.Find("ScoreText").GetComponent <Text>();
     scoreUI.text = "Score: 00000";
     // set up star name box variables
     blackBox = this.transform.GetChild(0).gameObject;
     starText = this.transform.GetChild(1).gameObject.GetComponent <Text>();
     textBox  = this.transform.GetChild(2).gameObject;
     // grab level manager and targetStar scripts
     lvlr         = GameObject.Find("LevelManager").GetComponent <LevelManager>();
     targetScript = GameObject.Find("TargetStarHandler").GetComponent <TargetStar>();
     // hide arrows
     initializeArrows();
     // sound variables set up
     selectionSound = gameObject.GetComponents <AudioSource>()[1];
     hintSound      = gameObject.GetComponents <AudioSource>()[0];
     incorrectSound = gameObject.GetComponents <AudioSource>()[2];
     closeSound     = (AudioClip)Resources.Load("sounds/boopClose");
     midSound       = (AudioClip)Resources.Load("sounds/boopMid");
     farSound       = (AudioClip)Resources.Load("sounds/boopFar");
     rapidSound     = (AudioClip)Resources.Load("sounds/boopRapid");
     // hide launch panel
     launchButton.gameObject.SetActive(false);
     launchPanel.gameObject.SetActive(false);
     // game state variable set up
     gameOver            = false;
     launchButtonHovered = false;
     // timer setup and hide star name box
     timer = GameObject.Find("Timer").GetComponent <TimerScript>();
     hideBox();
 }
Ejemplo n.º 2
0
 void Start()
 {
     // score set up
     scoreUI      = GameObject.Find("ScoreText").GetComponent <TextMeshProUGUI>();
     scoreUI.text = "00000";
     // set up star name box variables
     // blackBox = this.transform.GetChild(0).gameObject;
     starText = this.transform.GetChild(0).gameObject.GetComponent <TextMeshProUGUI>();
     textBox  = this.transform.GetChild(1).gameObject;
     // grab level manager and targetStar scripts
     lvlr         = GameObject.Find("LevelManager").GetComponent <LevelManager>();
     targetScript = GameObject.Find("TargetStarHandler").GetComponent <TargetStar>();
     // timer setup and hide star name box
     timer = GameObject.Find("Timer").GetComponent <TimerScriptWithTutorial>();
     hideBox();
     // hide arrows
     initializeArrows();
     // sound variables set up
     selectionSound = gameObject.GetComponents <AudioSource>()[1];
     hintSound      = gameObject.GetComponents <AudioSource>()[0];
     incorrectSound = gameObject.GetComponents <AudioSource>()[2];
     closeSound     = (AudioClip)Resources.Load("sounds/boopClose");
     midSound       = (AudioClip)Resources.Load("sounds/boopMid");
     farSound       = (AudioClip)Resources.Load("sounds/boopFar");
     rapidSound     = (AudioClip)Resources.Load("sounds/boopRapid");
     // game state variable set up
     gameOver            = false;
     launchButtonHovered = false;
     // hide launch panel
     launchObject.gameObject.SetActive(false);
     loseObject.gameObject.SetActive(false);
     // hide tutorial
     playTutorial = (PlayerPrefs.GetString("Replay") == "true" ? false : true);
     if (!playTutorial)
     {
         tutorial.GetComponent <TutorialHandler>().ReadyGo();
     }
 }