示例#1
0
    private static void LoadAllTiles()
    {
        foreach (TileType tileType in Enum.GetValues(typeof(TileType)))
        {
            string path = TilePaths.Get(tileType);

            if (path != null)
            {
                LayerTile[] loadedTiles = Resources.LoadAll <LayerTile>(path);
                loadedTiles.ToList().ForEach(x => tiles[tileType, x.name] = x);
            }
        }
    }
示例#2
0
    public bool CacheAllAssets()
    {
        layerTileCollections.Clear();
        foreach (TileType tileType in Enum.GetValues(typeof(TileType)))
        {
            string path = TilePaths.Get(tileType);

            if (path != null)
            {
                layerTileCollections.Add(new TilePathEntry
                {
                    path       = path,
                    tileType   = tileType,
                    layerTiles = Resources.LoadAll <LayerTile>(path).ToList()
                });
            }
        }

        return(true);
    }