示例#1
0
    private void Awake()
    {
        if (gameManager == null)
        {
            gameManager = this;
        }
        else if (gameManager != this)
        {
            Destroy(this);
        }
        goals = goalsParent.GetComponentsInChildren <Transform>();
        foreach (Transform t in goals)
        {
            if (t.CompareTag("Goal"))
            {
                goalsGameObject.Add(t.gameObject);
                t.gameObject.SetActive(false);
            }
        }
        int goal = Random.Range(0, goalsGameObject.Count);

        finishGoal = goalsGameObject[goal];
        finishGoal.SetActive(true);

        startingTransforms = startingTransParent.GetComponentsInChildren <Transform>();
        SetStartPosition();
    }
    private void Awake()
    {
        Instance = this;

        //Application.targetFrameRate = 60;
        if (Application.isMobilePlatform)
        {
            QualitySettings.vSyncCount = 0;
        }
    }
示例#3
0
    // Start is called before the first frame update
    void Start()
    {
        if (instance == null)
        {
            instance = this;
        }

        //isTutorial = ScoreKeeper.instance.isTutorial;
        gameStarted = false;
        isPaused    = false;
        canJump     = false;
        fogMoving   = false;
        gameOver    = false;
        winState    = false;

        pauseMenu.SetActive(false);

        level = ScoreKeeperOld.instance.startLevel;

        /*
         * sentences[0] = new string[] { levelOne };
         * sentences[1] = new string[levelTwo.Length];
         * sentences[2] = new string[levelThree.Length];
         * sentences[3] = new string[levelFour.Length];
         * sentences[4] = new string[levelFive.Length];
         */

        typedChars       = "";
        typedText.text   = typedChars;
        sentenceNum      = 0;
        untypedChars     = sentences[level, 0];
        untypedText.text = untypedChars;
        typedCharsSize   = typedChars.Length;
        untypedCharsSize = untypedChars.Length;

        upperCaseText = untypedText.text.ToUpper();
        currentChar   = upperCaseText[0];

        highlightPos = highlight.position;

        gameOverPanel.SetActive(false);
    }
示例#4
0
 // Use this for initialization
 void Awake()
 {
     points      = 0;
     agent       = GetComponent <UnityEngine.AI.NavMeshAgent>();
     gameManager = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManagerOld>();
 }