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); }
public SerialisableTileBackground(string backgroundType, ISerialisableTileBackground iSerialisableTileBackground) { BackgroundType = backgroundType; SerialisedData = JsonUtility.ToJson(iSerialisableTileBackground); }