public void CopyFromSource()
{
textureParams = new List <tk2dSpriteCollectionDefinition>(obj.textureParams.Length);
foreach (var v in obj.textureParams)
{
if (v == null)
{
textureParams.Add(null);
}
else
{
var t = new tk2dSpriteCollectionDefinition();
t.CopyFrom(v);
textureParams.Add(t);
}
}
textureRefs = new List <Texture2D>(obj.textureRefs.Length);
foreach (var v in obj.textureRefs)
{
textureRefs.Add(v);
}
spriteSheets = new List <tk2dSpriteSheetSource>();
if (obj.spriteSheets != null)
{
foreach (var v in obj.spriteSheets)
{
if (v == null)
{
spriteSheets.Add(null);
}
else
{
var t = new tk2dSpriteSheetSource();
t.CopyFrom(v);
spriteSheets.Add(t);
}
}
}
fonts = new List <tk2dSpriteCollectionFont>();
if (obj.fonts != null)
{
foreach (var v in obj.fonts)
{
if (v == null)
{
fonts.Add(null);
}
else
{
var t = new tk2dSpriteCollectionFont();
t.CopyFrom(v);
fonts.Add(t);
}
}
}
UpgradeLegacySpriteSheets();
var target = this;
var source = obj;
target.maxTextureSize = source.maxTextureSize;
target.forceTextureSize = source.forceTextureSize;
target.forcedTextureWidth = source.forcedTextureWidth;
target.forcedTextureHeight = source.forcedTextureHeight;
target.textureCompression = source.textureCompression;
target.atlasWidth = source.atlasWidth;
target.atlasHeight = source.atlasHeight;
target.forceSquareAtlas = source.forceSquareAtlas;
target.atlasWastage = source.atlasWastage;
target.allowMultipleAtlases = source.allowMultipleAtlases;
target.spriteCollection = source.spriteCollection;
target.premultipliedAlpha = source.premultipliedAlpha;
CopyArray(ref target.altMaterials, source.altMaterials);
CopyArray(ref target.atlasMaterials, source.atlasMaterials);
CopyArray(ref target.atlasTextures, source.atlasTextures);
target.useTk2dCamera = source.useTk2dCamera;
target.targetHeight = source.targetHeight;
target.targetOrthoSize = source.targetOrthoSize;
target.pixelPerfectPointSampled = source.pixelPerfectPointSampled;
target.physicsDepth = source.physicsDepth;
target.disableTrimming = source.disableTrimming;
target.normalGenerationMode = source.normalGenerationMode;
target.padAmount = source.padAmount;
target.autoUpdate = source.autoUpdate;
target.editorDisplayScale = source.editorDisplayScale;
}