示例#1
0
 void Start()
 {
     map = FindObjectOfType <MapTiles>();
     ui  = FindObjectOfType <UiShapeManager>();
 }
示例#2
0
    // Use this for initialization
    void Awake()
    {
        board          = FindObjectOfType <BoardManager>();
        solutionFinder = FindObjectOfType <FindSolution>();
        ui             = FindObjectOfType <UiShapeManager>();

        /*
         * matrix = new int[5, 5] {
         * {1,0,1,0,1},
         * {0,1,0,1,0},
         * {1,0,1,0,1},
         * {0,1,0,1,0},
         * {1,0,1,0,1},
         * };*/
        /*
         * matrix = new int[5, 5] {
         * {1,1,1,1,1},
         * {1,1,1,1,1},
         * {1,1,0,1,1},
         * {1,1,1,1,1},
         * {1,1,1,1,1}
         * };*/



        mapSizeX = 5;
        mapSizeY = 5;
        List <BoardManager.ShapeToComplete> temp = new List <BoardManager.ShapeToComplete>();

        temp.Add(new BoardManager.ShapeToComplete(new Shape.Rectangle(false)));
        temp.Add(new BoardManager.ShapeToComplete(new Shape.Diamond(true)));
        temp.Add(new BoardManager.ShapeToComplete(new Shape.Rectangle(true)));

        matrix = new int[5, 5] {
            { 1, 1, 1, 1, 1 },
            { 1, 1, 1, 1, 1 },
            { 1, 1, 1, 1, 1 },
            { 1, 1, 1, 1, 1 },
            { 1, 1, 1, 1, 1 }
        };
        levels.Enqueue(new GameManager.Level(mapSizeX, mapSizeY, matrix, temp));
        temp.Clear();


        mapSizeX = 5;
        mapSizeY = 5;

        temp.Add(new BoardManager.ShapeToComplete(new Shape.Rectangle(true)));
        temp.Add(new BoardManager.ShapeToComplete(new Shape.Rectangle(false)));
        temp.Add(new BoardManager.ShapeToComplete(new Shape.Rectangle(true)));

        matrix = new int[5, 5] {
            { 1, 1, 1, 1, 1 },
            { 1, 1, 1, 1, 1 },
            { 1, 1, 0, 1, 1 },
            { 1, 1, 1, 1, 1 },
            { 1, 1, 1, 1, 1 }
        };
        levels.Enqueue(new GameManager.Level(mapSizeX, mapSizeY, matrix, temp));
        matrix = new int[3, 3] {
            { 1, 1, 1 },
            { 1, 1, 1 },
            { 1, 1, 1 }
        };

        //matrix = new int[mapSizeX, mapSizeY];
        ////int _w,int _h,string _seed,bool _useSeed,int _fill,ref int[,] _map
        //LevelGeneration gen = new LevelGeneration(mapSizeX, mapSizeY, seed, useRandomSeed, randomFillPercent, ref matrix);
        //gen.GenerateMap();

        //GenerateMapData(matrix);
        //GenerateVisuals();
        //GenerateGraph();
        ////FindAllTriangles(new Vector2(0,0),new Vector2(mapSizeX,mapSizeY));
        //PlaceCamera();

        LoadLevel();
    }