void Start() { Time.timeScale = 1; gameOverScreen = transform.Find("GameOver").gameObject; gameOverStats = gameOverScreen.transform.Find("Stats").gameObject; gameOverScreenpos1 = gameOverScreen.transform.position; scoreDisplay = transform.Find("Score").Find("Text").GetComponent <TextMeshProUGUI>(); highScoreDisplay = transform.Find("High Score").Find("Text").GetComponent <TextMeshProUGUI>(); boneCounter = transform.Find("Bone Counter").gameObject; darkener = transform.Find("Darkener").gameObject; pauseMenu = transform.Find("PauseMenu").gameObject; pauseMenu.SetActive(false); adControl = GameObject.Find("Advertisement Manager").GetComponent <AdControl>(); socialControl = GameObject.Find("Social").GetComponent <SocialControl>(); mobileControls = transform.Find("Mobile Controls").gameObject; int usingAimJoystick = PlayerPrefs.GetInt("usingAimJoystick", 0); if (usingAimJoystick == 1) { GameObject aimJoystick = mobileControls.transform.Find("Aim Joystick").gameObject; aimJoystick.transform.position = Vector3.zero; aimJoystick.transform.localScale = new Vector3(6, 6, 1); aimJoystick.transform.Find("Visual").GetComponent <Image>().enabled = false; aimJoystick.transform.Find("Handle").GetComponent <Image>().enabled = false; } highScore = PlayerPrefs.GetInt("Highscore", 0); highScoreDisplay.text = "<color=#EEEEEE>High Score: " + highScore.ToString() + "</color>"; updateBoneCount(playerBones); }
/// <summary> /// Instancira se prazan Player objekat i dodeljuju reference za sve komponente /// </summary> void Awake() { player = new Player(); localDB = GameObject.Find("LocalDBControler").GetComponent <LocalDBControler>(); firebase = GameObject.Find("FirebaseControler").GetComponent <FirebaseControler>(); ui = GameObject.Find("UIControler").GetComponent <UIControler>(); fb = GameObject.Find("FacebookControler").GetComponent <FacebookControler>(); ads = GameObject.Find("AdsControler").GetComponent <AdsControler>(); purchaser = GameObject.Find("Purchaser").GetComponent <Purchaser>(); social = GameObject.Find("SocialControler").GetComponent <SocialControl>(); score = GameObject.Find("ScoreControler").GetComponent <ScoreControl>(); gift = GameObject.Find("RewardControler").GetComponent <RewardControl>(); }