// Start is called before the first frame update void Start() { scoreText = GameObject.Find("ScoreText").GetComponent <Text>(); scoreText2 = GameObject.Find("ScoreText2").GetComponent <Text>(); timeText = GameObject.Find("TimeText").GetComponent <Text>(); replayScoreText = GameObject.Find("ReplayButtonText").GetComponent <Text>(); scoreScript = GameObject.Find("ScoreScript").GetComponent <ScoreScript>(); gameControllerScript = GameObject.Find("GameControllerScript").GetComponent <GameControllerScript>(); projectileScriptv2 = GameObject.Find("Projectile Group").GetComponent <ProjectileScriptv2>(); slingshotScriptv2 = GameObject.Find("Slingshot Group").GetComponent <SlingshotScriptv2>(); obstaclesScript = GameObject.Find("Obstacles Group").GetComponent <ObstaclesScript>(); background = GameObject.Find("Background"); selectChar = GameObject.Find("Selectcharacter"); CatSelect = GameObject.Find("CatSelect"); PigSelect = GameObject.Find("PigSelect"); BearSelect = GameObject.Find("Bear"); PandaSelect = GameObject.Find("Panda"); GameStarter = GameObject.Find("StartButton"); ReplayButton = GameObject.Find("ReplayButton"); Logo = GameObject.Find("Logo"); GameStarter.SetActive(false); ReplayButton.SetActive(false); scoreText2.enabled = false; Plank = GameObject.Find("Seg6"); }
public void GameStart() { gameControllerScript.gameStart = true; CatSelect.SetActive(false); PigSelect.SetActive(false); BearSelect.SetActive(false); PandaSelect.SetActive(false); background.SetActive(false); selectChar.SetActive(false); Logo.SetActive(false); scoreScript.score = 0; Plank.GetComponent <Rigidbody2D>().freezeRotation = false; projectileScriptv2.launched = true; GameStarter.SetActive(false); }
public void SelectPanda() { gameControllerScript.character = "Panda"; GameStarter.SetActive(true); }
public void SelectBear() { gameControllerScript.character = "Bear"; GameStarter.SetActive(true); }
public void SelectCat() { gameControllerScript.character = "Cat"; GameStarter.SetActive(true); }