Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        levelCount = 0;
        newLevelCount = 30.0f;
        timerLimit = 1.0f;

        //Assign object spawn variables
        counterLimitMin = 1.0f;
        counterLimitMax = counterLimitMin * 5.0f;
        counterLimit = Random.Range(counterLimitMin, counterLimitMax);

        minX = 100.0f;
        myTransform = transform;
        isDead = true;
        startMarker = false;
        score = GameObject.FindGameObjectWithTag("Score").GetComponent<RunnerScoring>();
        sDetector = GameObject.FindGameObjectWithTag("Recognizer").GetComponent<TapDetector>();
        rPlayer = GameObject.FindGameObjectWithTag("Player").GetComponent<RunnerScript>();
        rCollision = GameObject.FindGameObjectWithTag("Player").GetComponent<RunnerCollision>();

        marker = GameObject.FindGameObjectWithTag("marker").GetComponent<MoveProgressBar>();
        markerStart = new Vector3(-500.0f, 355.0f, -80.0f);
        markerEnd = new Vector3(500.0f, 355.0f, -80.0f);

        numGates = 0;
        numGatesInLevel = 0;

        spawnedFinish = false;
        crossedFinish = false;
        finish = GameObject.FindGameObjectWithTag("lastObject").GetComponent<LevelFinishScroll>();
        levelText = GameObject.FindGameObjectWithTag("LevelText").GetComponent<LevelDisplay>();
        levelText.setTheLevelText(levelCount);

        //Pass speedVar objects
        bonusDown = GameObject.FindGameObjectWithTag("BonusDown");
        backBackgroundObjects = GameObject.FindGameObjectsWithTag("BackBackground");
        frontBackgroundObjects = GameObject.FindGameObjectsWithTag("FrontBackground");

        if (m_prefabChoices == null || m_prefabChoices.Length == 0)
        {
            return;
        }

        //test
        rPlayer.setGravity((rPlayer.getGravity() + speedVar * -0.10f));

        srslyCounterLimit = 10.0f;
    }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        //If not title screen
        if(Application.loadedLevel != 0 )
        {
            myTransform = transform;
            myTransform.localScale = new Vector3(Camera.main.orthographicSize * 3, Camera.main.orthographicSize * 2, 1.0f);
            spawner = GameObject.FindGameObjectWithTag("Spawner").GetComponent<SpawnObstacles>();
            rCollision = GameObject.FindGameObjectWithTag("Player").GetComponent<RunnerCollision>();
            cam = GameObject.FindGameObjectWithTag("MainCamera").camera;
            score2 = GameObject.FindGameObjectWithTag("Score").GetComponent<RunnerScoring>();
            lObjectSign = GameObject.FindGameObjectWithTag("lastObject").GetComponent<LevelFinishScroll>();

            //Populate background pillars
            backBackgroundObjects = GameObject.FindGameObjectsWithTag("BackBackground");
            frontBackgroundObjects = GameObject.FindGameObjectsWithTag("FrontBackground");
        }
    }