Exemplo n.º 1
0
        public void Awake()
        {
            pathMapDict = new Dictionary <BlockingType, PathMap>();
            //for each list of blocking layers (assumes BlockingType enum starts at 0)
            PathMap pMap;

            for (int t = 0; t < tilemapMatrix.lists.Length; t++)
            {
                if (tilemapMatrix.lists[t].tileMaps.Length != 0)
                {
                    //generate a PathMap
                    pMap = MapConverter.TilemapArrToPathMap(tilemapMatrix[(BlockingType)t].tileMaps, background.cellBounds);
                    //add to dictionary, with the current BlockingType as a key
                    pathMapDict.Add((BlockingType)t, pMap);
                }
            }
        }
Exemplo n.º 2
0
        /*
         * ==== INITIALIZATION ====
         *
         * A Navigator must generate nodes and grids based on the tilemaps in a scene.
         *
         */

        //regenerates pathMap, accounting for changes in blocking tilemaps.
        //probably unnecessary
        public void RefreshPathMap(BlockingType t)
        {
            pathMapDict[t] = MapConverter.TilemapArrToPathMap(tilemapMatrix[t].tileMaps, background.cellBounds);
        }