示例#1
0
    void Update()
    {
        // Check for next scene indicator
        if (Input.GetKeyDown("t"))
        {
            dungeonPlayerScene();
        }

        if (Application.loadedLevel == 1 && !built)
        {
            GameObject  go = GameObject.Find("GridManager");
            GridCreator gc = (GridCreator)go.GetComponent(typeof(GridCreator));
            gc.BuildGrid();
            built = true;
        }

        if (Application.loadedLevel == 2 && !built)
        {
            //if (size != 0) {
            GameObject  go = GameObject.Find("GridManager");
            GridCreator gc = (GridCreator)go.GetComponent(typeof(GridCreator));
            gc.BuildGrid();
            built = true;
            //}
        }
    }
示例#2
0
    public void load()
    {
        rd = SaveLoad.load();
        GridCreator gc = (GridCreator)gameObject.GetComponent(typeof(GridCreator));

        GameObject[] tiles = GameObject.FindGameObjectsWithTag("Tile");

        foreach (GameObject item in tiles)
        {
            Destroy(item);
        }

        //gc.BuildGrid (size);
        gc.BuildGrid();
    }