mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
[csharp] Thread safety for acquiring next VertexAttachment ID. 8a78eb4cf5
This commit is contained in:
parent
7481a05931
commit
61a5058a5c
@ -34,8 +34,17 @@ namespace Spine {
|
||||
/// <summary>>An attachment with vertices that are transformed by one or more bones and can be deformed by a slot's vertices.</summary>
|
||||
public class VertexAttachment : Attachment {
|
||||
static int nextID = 0;
|
||||
static Object nextIdLock = new Object();
|
||||
static int GetNextID () {
|
||||
int returnValue;
|
||||
lock (nextIdLock) {
|
||||
returnValue = nextID;
|
||||
nextID++;
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
internal readonly int id = (nextID++ & 65535) << 11;
|
||||
internal readonly int id = (VertexAttachment.GetNextID() & 65535) << 11;
|
||||
internal int[] bones;
|
||||
internal float[] vertices;
|
||||
internal int worldVerticesLength;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user