示例#1
0
        override public void ShowMapAt(int center_x, int center_y)
        {
            TileMapBaseConfig config = m_ArchiveFile.GetConfigFile <TileMapBaseConfig>();

            if (config != null)
            {
                TilePrefabConfig tpc = null;

                for (int y = 0; y < config.height; y++)
                {
                    for (int x = 0; x < config.width; x++)
                    {
                        tpc = config.GetTilePrefabConfig(m_ArchiveFile[x * config.width + y]);
                        if (tpc != null)
                        {
                            SpawnTileMapAt(
                                x,
                                y,
                                m_Config.grid_size,
                                m_MapRoot,
                                tpc);
                        }
                    }
                }
            }
        }
示例#2
0
 //待完善,暂时考虑只为PerlinMap编写!!!
 public MapArchiveFile(TileMapBaseConfig config)
 {
     m_Config        = config;
     m_MapConfigName = config.name;
     //这样写效率高,不会频繁的Resize!!!其实这里用数组也可以...
     m_MapData = new int[config.width * config.height];
     m_DecorationIndex.Clear();
 }
示例#3
0
        virtual public void InitMapViewer(MapArchiveFile file, Transform root)
        {
            //如果没有挂在高级资源读取器或对象池化资源管理器,则走默认逻辑。使用最笨的FallBack资源管理器。
            m_ResourceLoader = GetComponent <iResourceLoader>();
            if (m_ResourceLoader == null)
            {
                m_ResourceLoader = new DefaultResourceLoader();
            }

            m_ResourceLoader.Reset();

            m_ArchiveFile = file;
            m_MapRoot     = root;
            if (m_ArchiveFile != null)
            {
                m_Config = m_ArchiveFile.GetConfigFile <TileMapBaseConfig>();
            }
        }