Inheritance: MonoBehaviour
Esempio n. 1
0
 void Start()
 {
     HighScoreText.SetActive(false);
     scoreText.text = "0";
     Kills.SetActive(false);
     MyEventManager.Instance.DeactivatePooledObjects.Dispatch();
     LeanTween.value(0f, ScoreManager.Instance.GetScore(), .5f).setOnUpdate(OnUpdate).setOnComplete(OnComplete);
 }
Esempio n. 2
0
    private void Awake()
    {
        bestTimeTimeTrialText = GetComponentInChildren <SurvivalModeBestTimeText>();
        highScoreText         = GetComponentInChildren <HighScoreText>();
        leaderboardAnimator   = GetComponent <Animator>();


        _database = FirebaseDatabase.DefaultInstance;
    }
Esempio n. 3
0
    public void triggerGameOverMenu(int score, int highScore)
    {
        scoreToDisplay     = score;
        highScoreToDisplay = highScore;

        scoreText = GetComponentInChildren <ScoreText>();
        scoreText.setScoreText(scoreToDisplay);

        highScoreText = GetComponentInChildren <HighScoreText>();
        highScoreText.setHighScore(highScoreToDisplay);

        animatorController = gameObject.GetComponent <Animator>();
        animatorController.SetTrigger("trigger-activation");
    }
Esempio n. 4
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            base.Draw(spriteBatch);

            AlignText(WinAllText, Alignment.Center, 75);
            AlignText(HighScoreText, Alignment.Center, 140);

            //AlignText(WinAllText, Alignment.Center, 25);
            //AlignText(HighScoreText, Alignment.Center, 90);

            WinAllText.Draw(spriteBatch);
            HighScoreText.Draw(spriteBatch);

            // TODO: deadline :(
            //TextBox.Draw(spriteBatch);
            SaveButton.Draw(spriteBatch);
        }
Esempio n. 5
0
    private void Start()
    {
        fadeTexts     = FindObjectsOfType <FadeText>();
        highScoreText = FindObjectOfType <HighScoreText>();
        spawners      = FindObjectsOfType <Spawner>();
        currentBird   = FindObjectOfType <Bird>();
        audioPlayer   = FindObjectOfType <AudioPlayer>();
        groundSpawner = GameObject.Find("Ground Spawner").GetComponent <MountainSpawner>();
        if (!currentBird)
        {
            currentBird = Instantiate(birdPrefab);
        }

        windPlayer = FindObjectOfType <WindPlayer>();

        realScrollSpeedIncreaseRate = -scrollSpeedIncreaseRate / 1000;
        scrollSpeed = -startingScrollSpeed;
    }
    // Update is called once per frame
    void Update()
    {
        if (isGameOver)
        {
            if (Input.GetButtonDown("Fire1") || Input.GetButtonDown("Fire2") || Input.GetButtonDown("Fire3"))
            {
                ResetGame();
            }
            return;
        }
        waveTimer   += Time.deltaTime;
        pointsTimer += Time.deltaTime;

        if (waveTimer > waveTime)
        {
            waveTimer        = waveTimer - waveTime;
            wave            += 1;
            corruptionChance = Mathf.Min(corruptionChance + 5, 80);
            corruptBotsByChance();
            waveText.SetText("" + wave);
            corruptionChanceText.SetText("" + corruptionChance + "%");
            SpawnEnemies();
        }
        if (pointsTimer > pointsTime)
        {
            pointsTimer = pointsTimer - pointsTime;
            SpawnPointsPickup();
            pointsTime = Random.Range(4f, 10f);
        }
        scoreText.SetText("" + score);
        if (score > highScore)
        {
            highScore = score;
            HighScoreText.SetText("" + highScore);
        }
    }
Esempio n. 7
0
 private void AnimateHighscore()
 {
     HighScoreText.SetActive(true);
     LeanTween.value(.8f, 1f, .5f).setOnUpdate(OnValueChanged).setLoopPingPong();
 }