Пример #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;
    }