Exemplo n.º 1
0
    //Set up the position of the new car, its speed, etc.
    private void setupNewTerrain(GameObject terrain)
    {
        MiscObjectMover mover = terrain.AddComponent <MiscObjectMover> ();

        mover.levelSceneController = levelSceneController;
        mover.setVelocity(SceneConstants.BASE_OBJECT_VELOCITY);
    }
Exemplo n.º 2
0
    //A new bridge object gets a MiscObjectMover component attached to it to move it through the scene
    private void setupNewBridge(GameObject bridge)
    {
        MiscObjectMover mover = bridge.GetComponent <MiscObjectMover> ();

        mover.setVelocity(SceneConstants.BASE_OBJECT_VELOCITY);
        float width = Random.Range(1.0f, 4f);

        bridge.transform.localScale = new Vector3(1, 1, width);
    }