public static SpriteAssetData CreateSprite(SerializedAssets assets, AssetPtr customTexture) { // Default Sprite ulong pd = 45; var sp = assets.GetAssetAt(pd); if (!sp.data.GetType().Equals(typeof(SpriteAssetData))) { Console.WriteLine($"[ERROR] Default Sprite data does not exist at PathID: {pd} instead it has Type {sp.data.GetType()} with TypeID: {sp.typeID} and classid: {assets.types[sp.typeID].classID}"); } var sprite = sp.data as SpriteAssetData; return(new SpriteAssetData() { name = "CustomPackCover", texture = customTexture, atlasTags = sprite.atlasTags, extrude = sprite.extrude, floats = sprite.floats, guid = sprite.guid, isPolygon = sprite.isPolygon, second = sprite.second, spriteAtlas = sprite.spriteAtlas, bytesAfterTexture = sprite.bytesAfterTexture }); }
public AssetObject GetAssetAt(ulong pathID) { return(_assets.GetAssetAt(pathID)); }