Esempio n. 1
0
 void Start()
 {
     Cursor.visible  = false;
     screenCenter    = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width / 2, Screen.height / 2, 0));
     words           = WordsContainer.GetAllPairsForShootingGame();
     currentCategory = DrawTaskCategory.GetCurrentCategory();
     word.text       = SetCurrentWord();
     SetWordRotation();
     movementVector   = (screenCenter - transform.position).normalized * speed;
     movementVector.z = 0;
     currentLifeTime  = lifeTime;
     timer            = waitTime;
 }
Esempio n. 2
0
    private void GameOver()
    {
        if (SetScore.wordCount >= SetScore.maxScore)
        {
            GameObject[] gameObjects;
            gameObjects = GameObject.FindGameObjectsWithTag("WordObject");

            foreach (var word in gameObjects)
            {
                Destroy(word);
            }

            DrawTaskCategory.ShowWinText();
            WordSpawn game = Camera.main.GetComponent <WordSpawn>();
            SaveTaskData();
            MakeTaskInactive();
            UpdateProgressBar();
            Cursor.visible     = true;
            game.enabled       = false;
            SetScore.wordCount = 0;
        }
    }