Exemple #1
0
    private List <SerialisableTileBackground> SerialiseTileBackgrounds(Tile tile)
    {
        List <SerialisableTileBackground> tilebackgrounds = new List <SerialisableTileBackground>();

        foreach (ITileBackground tileBackground in tile.GetBackgrounds())
        {
            ISerialisableTileBackground iSerialisableTileBackground = CreateSerialisableTileBackground(tileBackground);

            SerialisableTileBackground serialisableTileBackground = new SerialisableTileBackground(
                iSerialisableTileBackground.GetType().ToString(), iSerialisableTileBackground
                );
            tilebackgrounds.Add(serialisableTileBackground);
        }

        return(tilebackgrounds);
    }
Exemple #2
0
 public SerialisableTileBackground(string backgroundType, ISerialisableTileBackground iSerialisableTileBackground)
 {
     BackgroundType = backgroundType;
     SerialisedData = JsonUtility.ToJson(iSerialisableTileBackground);
 }