// Start is called before the first frame update void Start() { GameManager = GameObject.Find("Scripts").GetComponent <GameManager>(); ScoreController = GameObject.Find("PlayerDetails").GetComponent <HighScoreScript>(); timerText = GameObject.Find("Time").GetComponent <Text>(); StartCoroutine(timer()); }
// Use this for initialization void Awake() { blockGrid = new GameObject[towerWidth, towerHeight]; currentHeights = new int[6] { 0, 0, 0, 0, 0, 0 }; audioManager = new GameObject().AddComponent <AudioScript>(); Camera.main.transform.position = new Vector3(2.5f, 7f, -10f); Camera.main.orthographic = true; Camera.main.orthographicSize = 7.5f; highScoreManager = gameObject.AddComponent <HighScoreScript>(); initializeBlockWell(); initializeBlockPair(); initializeDestroyBlock(); initializeScoreText(); initializeAlertText(); flashPermanentAlert("Press ENTER to begin."); debugPointsPerLevel = new int[100]; }
// Start is called before the first frame update void Start() { nameInputField = GameObject.Find("NText"); registerButton = GameObject.Find("StrtButton"); score_controller = GameObject.Find("PlayerDetails").GetComponent <HighScoreScript>(); registerButton.GetComponent <Button>().onClick.AddListener(registerButtonPressed); }
// Start is called before the first frame update void Start() { GameManager = GameObject.Find("Scripts").GetComponent <GameManager>(); pastPositions = new List <Vector3>(); score_controller = GameObject.Find("PlayerDetails").GetComponent <HighScoreScript>(); TimeManager = GameObject.Find("Canvas").GetComponent <TimeScript>(); if (SceneManager.GetActiveScene().name == "Lvl2") { snakeLength = 5; } if (SceneManager.GetActiveScene().name == "Lvl3") { snakeLength = 1; } for (int i = 0; i < snakeLength; i++) { GameObject g = Instantiate(tailPrefab, new Vector3(gameObject.transform.position.x, gameObject.transform.position.y + (i + 1), 0f), Quaternion.identity); // Keep track of it in our tail list tailPositions.Insert(tailPositions.Count, g.transform); } }
// Start is called before the first frame update void Start() { scoreText = GameObject.Find("Score").GetComponent <Text>(); score_controller = GameObject.Find("PlayerDetails").GetComponent <HighScoreScript>(); playerHead = Resources.Load <GameObject>("Prefabs/PlayerSnake"); foodPrefab = Resources.Load <GameObject>("Prefabs/Food"); enemyPrefab = Resources.Load <GameObject>("Prefabs/EnemySnake"); SpawnPlayer(); }
private void Awake() { inctance = this; if (PlayerPrefs.HasKey("SaveScore")) { highScoreCounter = PlayerPrefs.GetInt("SaveScore"); } }
void Start() { //playerOrder = 0; playerName = PlayerPrefs.GetString("PlayerID"); highscoreManager = GetComponent <HighScoreScript>(); for (int i = 0; i < highscoreText.Length; i++) { highscoreText[i].text = i + 1 + ".Fetching..."; } StartCoroutine(RefreshHighScores()); }
// Start is called before the first frame update void Awake() { if (Instance == null) { DontDestroyOnLoad(gameObject); Instance = this; } else if (Instance != this) { Destroy(gameObject); } }
void Awake() { DontDestroyOnLoad(this); if (instance == null) { instance = this; } else { Destroy(this.gameObject); } }
public void ShowScreenOnly(string screenName) { StartCoroutine(fadeAwayScript.FadeAway()); foreach (var item in screensList) { GameObject screen = item.Value; screen.SetActive((item.Key == screenName)); } if (screenName == "HighScore" || screenName == "GameOver") { HighScoreScript highScore = screensList[screenName].GetComponentInChildren <HighScoreScript>(); highScore.DisplayScores(); } }
private void voiceEvaluateObj(bool boolean) { if (boolean) { //Debug.Log("You're correct"); winPanel.SetActive(true); PlayerPrefs.SetInt("TmpScore", (PlayerPrefs.GetInt("TmpScore", 00) + 2)); score.text = PlayerPrefs.GetInt("TmpScore", 00).ToString(); Start(); } else { //Debug.Log("Wrong Answer"); failPanel.SetActive(true); HighScoreScript.insertScore(PlayerPrefs.GetInt("TmpScore")); } }
// Use this for initialization void Start () { lblStyle.fontSize = 24; lblStyle.alignment = TextAnchor.MiddleCenter; HighScoreScript hsScript = (HighScoreScript) gameObject.GetComponent(typeof(HighScoreScript)); //hsScript.Save(); // This will reset highscores hsScript.Load(); highScore1 = hsScript.highScores.highscore1; highScore2 = hsScript.highScores.highscore2; highScore3 = hsScript.highScores.highscore3; highScore4 = hsScript.highScores.highscore4; highScore5 = hsScript.highScores.highscore5; scrollStarted = false; scrollXValue = 0; AdHandlerScript.showBanner(); }
void Start() { //degisim highScoreScript = GameObject.Find("HighScoreObject").GetComponent <HighScoreScript>(); instantiateObject = GameObject.Find("InstantiateEnemy"); playerObject = GameObject.FindGameObjectWithTag("Player"); kingScript = playerObject.GetComponent <RedKing>(); adPanel = GameObject.Find("adPanel"); adScript = GameObject.Find("adManagerObject").GetComponent <MobadScript>(); adPanel.SetActive(false); isAdStateFinished = false; isPlayerMadeChoice = false; panelActivated = false; isItTimeToGo = false; isCountUpdated = false; adCount = PlayerPrefs.GetInt("PlayerDontWatchTheAds"); }
private void evaluateObj(Sprite sprite) { if (GetComponent <Image>().sprite == sprite) { //Debug.Log("You're correct"); winPanel.SetActive(true); PlayerPrefs.SetInt("TmpScore", (PlayerPrefs.GetInt("TmpScore", 00) + 2)); score.text = PlayerPrefs.GetInt("TmpScore", 00).ToString(); Start(); } else { //Debug.Log("Wrong Answer"); failPanel.SetActive(true); HighScoreScript.insertScore(PlayerPrefs.GetInt("TmpScore")); } }
void Start() { Debug.Log("Victors pik er f*****g lille"); Debug.Log("hahahahha"); BPM = GameManager.GetComponent <ButtonPressManager>(); HSS = GameManager.GetComponent <HighScoreScript>(); if (YoungFile != null) { YoungLines = (YoungFile.text.Split('\n')); } if (MiddleFile != null) { MiddleLines = (MiddleFile.text.Split('\n')); } if (OldFile != null) { OldLines = (OldFile.text.Split('\n')); } if (YoungEndAtLine == 0) { YoungEndAtLine = YoungLines.Length - 1; } if (MiddleEndAtLine == 0) { MiddleEndAtLine = MiddleLines.Length - 1; } if (OldEndAtLine == 0) { OldEndAtLine = OldLines.Length - 1; } //if (isActive) //{ // EnableTextBox(); //} }
// Use this for initialization void Start () { /*GameObject carObject = GameObject.Find ("Player"); if (carObject != null) { SpriteRenderer carSprite = carObject.GetComponent<SpriteRenderer>(); if(carSprite != null) { if(SelectedLevelScript.selectedCar == 1) carSprite.sprite = Resources.Load<UnityEngine.Sprite>("car2"); else if(SelectedLevelScript.selectedCar == 2) carSprite.sprite = Resources.Load<UnityEngine.Sprite>("rallycar"); } }*/ HighScoreScript hsScript = (HighScoreScript) gameObject.GetComponent(typeof(HighScoreScript)); //hsScript.Save(); // This will reset highscores hsScript.Load(); obstacleIndex = 0; obstacleCount = 0; iteration = 0; startTimer = 0; videoAdToBeShown = false; interstitialToBeShown = false; float screenAspect = (float)Screen.width / (float)Screen.height; float cameraHeight = Camera.main.orthographicSize * 2; stage_bounds = new Bounds( Camera.main.transform.position, new Vector3(cameraHeight * screenAspect, cameraHeight, 0)); CreateObstacles (); showingNumber = 4; easyPort = true; prevObstacle = 0; }
// Update is called once per frame async void Update() { if (player) { score = player.GetComponent <PlayerScript>().Score(); } timer += Time.deltaTime; if (timer >= interval) { currentBudget = budget; timer -= interval; GameObject nextHazard; int price; int count1 = 0; int count2 = 0; do { count1++; int oldBudget = currentBudget; do { count2++; nextHazard = hazardPrefabs[Random.Range(0, hazardPrefabs.Length)]; if (!laserUsed && nextHazard == hazardPrefabs[3]) { laserUsed = true; } else if (nextHazard == hazardPrefabs[3]) { do { nextHazard = hazardPrefabs[Random.Range(0, hazardPrefabs.Length)]; }while (nextHazard == hazardPrefabs[3]); } price = nextHazard.GetComponent <Hazard>().Spend(currentBudget); currentBudget -= price; }while (oldBudget == currentBudget); Vector3 nextHazardPosition; Quaternion nextHazardRotation; if (odd) { nextHazardPosition = nextHazard.GetComponent <Hazard>().GetImplementLoc1(); nextHazardRotation = nextHazard.GetComponent <Hazard>().GetImplementRot1(); } else { nextHazardPosition = nextHazard.GetComponent <Hazard>().GetImplementLoc2(); nextHazardRotation = nextHazard.GetComponent <Hazard>().GetImplementRot2(); } odd = !odd; GameObject haz = Instantiate(nextHazard, nextHazardPosition, nextHazardRotation); haz.GetComponent <Hazard>().ApplySpend(price); }while (currentBudget > lowestCost); laserUsed = false; budget += budgetIncrement; } if (submit) { submit = false; // never submit again // Upload the high score await HighScoreScript.UploadHighScore(playersName, (int)score); // Get high score display highScoreList = await HighScoreScript.GetHighScores(); // Set as submitted submitted = true; } }
void Awake() { HighScoreRef = GetComponent<HighScoreScript>(); }
void Awake() { highScore = transform.parent.GetComponentInChildren <HighScoreScript>(); infoDisplay = GetComponent <InfoDisplayScript>(); }
public void showHighScore() //executes the update method in HighScoreScript { HighScoreScript.showHighScore(); }
void DoGameOverWindow(int windowID) { if (!AdHandlerScript.bannerVisible) { AdHandlerScript.showBanner(); } GUI.skin = mainSkin; GUI.skin.button.fontSize = 22 * Screen.height / 800; float btnHeight = Screen.height / 16; float btnWidth = Screen.width / 4; float lblStartY = btnHeight; float btnStartY = Screen.width / 2 + 1.6f*btnHeight; lblStyleBig.fontSize = 34 * Screen.height / 800; lblStyle.fontSize = 26 * Screen.height / 800; GUI.Label(new Rect(Screen.width / 2 -1.3f*btnWidth, Screen.height / 10, 2*btnWidth, btnHeight), "GAME OVER!", lblStyleBig); GUI.Label(new Rect(Screen.width / 2 -1.0f*btnWidth, Screen.height / 10+1.5f*btnHeight, 2*btnWidth, btnHeight), "SCORE: "+ CarScript.score.ToString(), lblStyle); HighScoreScript hsScript = (HighScoreScript) gameObject.GetComponent(typeof(HighScoreScript)); int hsScore = 0; if (SelectedLevelScript.selectedLevel == 1) { hsScore = hsScript.highScores.highscore1; } else if (SelectedLevelScript.selectedLevel == 2) { hsScore = hsScript.highScores.highscore2; } else if (SelectedLevelScript.selectedLevel == 3) { hsScore = hsScript.highScores.highscore3; } else if (SelectedLevelScript.selectedLevel == 4) { hsScore = hsScript.highScores.highscore4; } else if (SelectedLevelScript.selectedLevel == 5) { hsScore = hsScript.highScores.highscore5; } int carScore = CarScript.score; if (hsScore <= carScore) { GUI.Label (new Rect (Screen.width / 2 - 1.5f * btnWidth, Screen.height / 10 + 3f * btnHeight, btnWidth*5, btnHeight), "THAT'S A HIGHSCORE!", lblStyle); if (SelectedLevelScript.selectedLevel == 1) { hsScript.highScores.highscore1 = carScore; } else if (SelectedLevelScript.selectedLevel == 2) { hsScript.highScores.highscore2 = carScore; } else if (SelectedLevelScript.selectedLevel == 3) { hsScript.highScores.highscore3 = carScore; } else if (SelectedLevelScript.selectedLevel == 4) { hsScript.highScores.highscore4 = carScore; } else if (SelectedLevelScript.selectedLevel == 5) { hsScript.highScores.highscore5 = carScore; } hsScript.Save(); } if (GUI.Button(new Rect(Screen.width / 2 -btnWidth, btnStartY, btnWidth, 1.2f*btnHeight), " RESTART")) Application.LoadLevel("GameScene"); if (GUI.Button(new Rect(Screen.width / 2 -btnWidth, btnStartY+2*btnHeight, btnWidth, 1.2f*btnHeight), " BACK")) Application.LoadLevel("LevelScene"); if (videoAdToBeShown) { AdHandlerScript.showVideoAd(); videoAdToBeShown = false; } if (interstitialToBeShown) { AdHandlerScript.showInterstitial(); interstitialToBeShown = false; } }