mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 17:26:01 +08:00
[unity] Fixed Skin created by GetRepackedSkin not copying bones list. Closes #1474.
This commit is contained in:
parent
12ca54ab5e
commit
159d71b827
@ -141,6 +141,23 @@ namespace Spine {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Additional overload provided because ExposedList<T> only implements IEnumerable<T>,
|
||||||
|
// leading to sub-optimal behavior: It grows multiple times as it assumes not
|
||||||
|
// to know the final size ahead of insertion.
|
||||||
|
public void AddRange (ExposedList<T> list) {
|
||||||
|
CheckCollection(list);
|
||||||
|
|
||||||
|
int collectionCount = list.Count;
|
||||||
|
if (collectionCount == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
GrowIfNeeded(collectionCount);
|
||||||
|
list.CopyTo(Items, Count);
|
||||||
|
Count += collectionCount;
|
||||||
|
|
||||||
|
version++;
|
||||||
|
}
|
||||||
|
|
||||||
public void AddRange (IEnumerable<T> collection) {
|
public void AddRange (IEnumerable<T> collection) {
|
||||||
CheckCollection(collection);
|
CheckCollection(collection);
|
||||||
|
|
||||||
|
|||||||
@ -324,6 +324,8 @@ namespace Spine.Unity.AttachmentTools {
|
|||||||
var skinAttachments = o.Attachments;
|
var skinAttachments = o.Attachments;
|
||||||
var newSkin = new Skin(newName);
|
var newSkin = new Skin(newName);
|
||||||
|
|
||||||
|
newSkin.bones.AddRange(o.bones);
|
||||||
|
|
||||||
// Use these to detect and use shared regions.
|
// Use these to detect and use shared regions.
|
||||||
var existingRegions = new Dictionary<AtlasRegion, int>();
|
var existingRegions = new Dictionary<AtlasRegion, int>();
|
||||||
var regionIndexes = new List<int>();
|
var regionIndexes = new List<int>();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user