예제 #1
0
    private void Awake()
    {
        m_FoundPath = new List <Vector2Int>();
        List <MapKeyData> data = new List <MapKeyData>();

        foreach (MapKeyDataMono readerMono in m_MapReaderMono)
        {
            MapKeyData d = new MapKeyData(readerMono.TileType, readerMono.Prefab);
            data.Add(d);
        }

        m_MapReader = new MapReader();
        m_CreateMap = new CreateMap(data, m_TxtFile);
        m_CreateMap.MapCreator();

        foreach (var item in m_CreateMap.WalkablePath)
        {
            m_FoundPath.Add(new Vector2Int(item.x / 2, item.y / 2));
        }

        m_StartPos = new Vector2Int(m_CreateMap.StartTilePos.x / 2, m_CreateMap.StartTilePos.y / 2);
        m_EndPos   = new Vector2Int(m_CreateMap.EndTilePos.x / 2, m_CreateMap.EndTilePos.y / 2);
    }