コード例 #1
0
ファイル: MapGenerator.cs プロジェクト: solaris0115/HeroSnake
    // Use this for initialization
    void Start()
    {
        space = new mSpace(0, 0, width - 1, height - 1);
        map   = new Tree(space);

        map = map.splitmSpace(space, splitTime);

        tm = TileMapManager.Instance;
        tm.Initialize(width, height);

        //Debug.Log(tm.GetTile(1, 2));
        //Tile test;
        //test = tm.GetTile(1, 2);
        //test.SetGroundInfo(EGround.Wall);
        Tree temp = map;

        drawPath(map, PathType.Wall);
        makeRoom(temp);
        drawSplitedSpace(temp);
        drawPath(map, PathType.Path);


        //drawPathBlock(map.root.mx, map.root.my);
        //Debug.Log(GetSpaceFromTree(map).root.x);
    }
コード例 #2
0
    void Start()
    {
        //Set the game managers instance to this so that we can access it statically
        GameManager.instance = this;

        //Initialise the item database
        ItemDatabase.LoadDatabase();

        //Load the map prefab and initialize it
        var prefab   = Resources.Load <GameObject>("Prefabs/TileMap");
        var instance = Instantiate(prefab);

        MapView = instance.GetComponent <ITileMapObject>();

        //create the map manager and pass it the map object
        MapManager = gameObject.AddComponent <TileMapManager>();
        MapManager.Initialize(MapView);

        selectionPrefab = Resources.Load <GameObject>("Prefabs/SelectedObject");
        //Initialize the starting state of the game
        StartGame();
    }