Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        levelManager = this;
        levelBuffer  = this.GetComponent <LevelBuffer>();
        //levelFactory = this.GetComponent<LevelFactory>();
        levelFactory = GameObject.Find("LevelFactory").GetComponent <LevelFactory>();

        GameObject Lvl = GameObject.Find("StartLevel");

        if (Lvl != null)
        {
            buildingHeight = Lvl.transform.localScale.y;
            Debug.Log(buildingHeight);
            levelBuffer.Enqueue(Lvl);
            //3.80f
            //Debug.Log(buildingHeight);
            temp = new Vector3(0, 4.80f, 0);

            if (!loadOnce)
            {
                for (int i = 0; i < 1; i++)
                {
                    LoadNewLevel();
                }
                loadOnce = true;
            }
        }
    }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        levelManager = this;
        levelBuffer  = this.GetComponent <LevelBuffer>();
        //levelFactory = this.GetComponent<LevelFactory>();

        GameObject Lvl             = GameObject.Find("Buildings1");
        GameObject levelFactoryRef = GameObject.Find("LevelFactory");

        levelFactory = levelFactoryRef.GetComponent <LevelFactory>();

        if (Lvl != null)
        {
            buildingHeight = Lvl.transform.localScale.y + 2f;

            levelBuffer.Enqueue(Lvl);

            Debug.Log(buildingHeight);
            temp = new Vector3(0, 73.95f, 0);
            Debug.Log("change height: " + buildingHeight);
            if (!loadOnce)
            {
                //for (int i = 0; i < 2; i++)
                //{
                LoadNewLevel();
                //}
                loadOnce = true;
            }
        }
        else
        {
            Debug.Log("initial level null");
        }
    }