Эх сурвалжийг харах

Merge remote-tracking branch 'origin/master'

NathanSweet 9 жил өмнө
parent
commit
715578983c
47 өөрчлөгдсөн 4961 нэмэгдсэн , 3451 устгасан
  1. BIN
      spine-as3/spine-as3-example/lib/spine-as3.swc
  2. 1 1
      spine-as3/spine-as3/src/spine/SkeletonJson.as
  3. 3 3
      spine-c/src/spine/Atlas.c
  4. 9 2
      spine-c/src/spine/SkeletonBinary.c
  5. 11 0
      spine-c/src/spine/SkeletonJson.c
  6. 1 1
      spine-cocos2dx/example/Classes/GoblinsExample.cpp
  7. 1 1
      spine-cocos2dx/example/Classes/RaptorExample.cpp
  8. 1 1
      spine-cocos2dx/example/Classes/SpineboyExample.cpp
  9. 1 1
      spine-cocos2dx/example/Classes/TankExample.cpp
  10. 8 0
      spine-cocos2dx/example/proj.ios_mac/spine-cocos2d-x.xcodeproj/project.pbxproj
  11. 31 24
      spine-cocos2dx/src/spine/SkeletonAnimation.cpp
  12. 19 9
      spine-cocos2dx/src/spine/SkeletonAnimation.h
  13. 23 14
      spine-cocos2dx/src/spine/SkeletonBatch.cpp
  14. 37 5
      spine-cocos2dx/src/spine/SkeletonRenderer.cpp
  15. 5 3
      spine-cocos2dx/src/spine/SkeletonRenderer.h
  16. BIN
      spine-starling/spine-starling-example/lib/spine-as3.swc
  17. BIN
      spine-starling/spine-starling/lib/spine-as3.swc
  18. 133 129
      spine-ts/build/spine-all.d.ts
  19. 558 553
      spine-ts/build/spine-all.js
  20. 0 0
      spine-ts/build/spine-all.js.map
  21. 133 129
      spine-ts/build/spine-core.d.ts
  22. 949 527
      spine-ts/build/spine-core.js
  23. 0 0
      spine-ts/build/spine-core.js.map
  24. 133 129
      spine-ts/build/spine-threejs.d.ts
  25. 558 553
      spine-ts/build/spine-threejs.js
  26. 0 0
      spine-ts/build/spine-threejs.js.map
  27. 133 129
      spine-ts/build/spine-webgl.d.ts
  28. 949 527
      spine-ts/build/spine-webgl.js
  29. 0 0
      spine-ts/build/spine-webgl.js.map
  30. 133 129
      spine-ts/build/spine-widget.d.ts
  31. 949 527
      spine-ts/build/spine-widget.js
  32. 0 0
      spine-ts/build/spine-widget.js.map
  33. 11 11
      spine-ts/core/src/AnimationState.ts
  34. 1 1
      spine-ts/core/src/Skin.ts
  35. 1 2
      spine-ts/core/src/TextureAtlasAttachmentLoader.ts
  36. 5 0
      spine-ts/core/src/Utils.ts
  37. 1 0
      spine-ts/core/src/attachments/RegionAttachment.ts
  38. 1 2
      spine-ts/threejs/src/ThreeJsTexture.ts
  39. 1 1
      spine-ts/webgl/example/index.html
  40. 59 19
      spine-unity/Assets/spine-unity/Asset Types/Editor/AtlasAssetInspector.cs
  41. 61 0
      spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs
  42. 2 2
      spine-unity/Assets/spine-unity/Editor/SpineInspectorUtility.cs
  43. 18 8
      spine-unity/Assets/spine-unity/Mesh Generation/Arrays/ArraysMeshGenerator.cs
  44. 1 2
      spine-unity/Assets/spine-unity/Modules/BoundingBoxFollower/BoundingBoxFollower.cs
  45. 8 2
      spine-unity/Assets/spine-unity/SkeletonExtensions.cs
  46. 4 2
      spine-unity/Assets/spine-unity/SkeletonRenderer.cs
  47. 8 2
      spine-unity/Assets/spine-unity/SkeletonUtility/Editor/SkeletonUtilityInspector.cs

BIN
spine-as3/spine-as3-example/lib/spine-as3.swc


+ 1 - 1
spine-as3/spine-as3/src/spine/SkeletonJson.as

@@ -198,7 +198,7 @@ public class SkeletonJson {
 
 
 			pathConstraintData.positionMode = PositionMode[constraintMap["positionMode"] || "percent"];
 			pathConstraintData.positionMode = PositionMode[constraintMap["positionMode"] || "percent"];
 			pathConstraintData.spacingMode = SpacingMode[constraintMap["spacingMode"] || "length"];
 			pathConstraintData.spacingMode = SpacingMode[constraintMap["spacingMode"] || "length"];
-			pathConstraintData.rotateMode = RotateMode[constraintMap["rotateMode"] || "rotateMode"];
+			pathConstraintData.rotateMode = RotateMode[constraintMap["rotateMode"] || "tangent"];
 			pathConstraintData.offsetRotation = Number(constraintMap["rotation"] || 0);
 			pathConstraintData.offsetRotation = Number(constraintMap["rotation"] || 0);
 			pathConstraintData.position = Number(constraintMap["position"] || 0);
 			pathConstraintData.position = Number(constraintMap["position"] || 0);
 			if (pathConstraintData.positionMode == PositionMode.fixed) pathConstraintData.position *= scale;
 			if (pathConstraintData.positionMode == PositionMode.fixed) pathConstraintData.position *= scale;

+ 3 - 3
spine-c/src/spine/Atlas.c

@@ -208,11 +208,11 @@ spAtlas* spAtlas_create (const char* begin, int length, const char* dir, void* r
 				page->height = toInt(tuple + 1);
 				page->height = toInt(tuple + 1);
 				if (!readTuple(&begin, end, tuple)) return abortAtlas(self);
 				if (!readTuple(&begin, end, tuple)) return abortAtlas(self);
 			}
 			}
-			page->format = (spAtlasFormat)indexOf(formatNames, 7, tuple);
+			page->format = (spAtlasFormat)indexOf(formatNames, 8, tuple);
 
 
 			if (!readTuple(&begin, end, tuple)) return abortAtlas(self);
 			if (!readTuple(&begin, end, tuple)) return abortAtlas(self);
-			page->minFilter = (spAtlasFilter)indexOf(textureFilterNames, 7, tuple);
-			page->magFilter = (spAtlasFilter)indexOf(textureFilterNames, 7, tuple + 1);
+			page->minFilter = (spAtlasFilter)indexOf(textureFilterNames, 8, tuple);
+			page->magFilter = (spAtlasFilter)indexOf(textureFilterNames, 8, tuple + 1);
 
 
 			if (!readValue(&begin, end, &str)) return abortAtlas(self);
 			if (!readValue(&begin, end, &str)) return abortAtlas(self);
 
 

+ 9 - 2
spine-c/src/spine/SkeletonBinary.c

@@ -72,8 +72,13 @@ spSkeletonBinary* spSkeletonBinary_create (spAtlas* atlas) {
 }
 }
 
 
 void spSkeletonBinary_dispose (spSkeletonBinary* self) {
 void spSkeletonBinary_dispose (spSkeletonBinary* self) {
+	int i;
 	_spSkeletonBinary* internal = SUB_CAST(_spSkeletonBinary, self);
 	_spSkeletonBinary* internal = SUB_CAST(_spSkeletonBinary, self);
 	if (internal->ownsLoader) spAttachmentLoader_dispose(self->attachmentLoader);
 	if (internal->ownsLoader) spAttachmentLoader_dispose(self->attachmentLoader);
+	for (i = 0; i < internal->linkedMeshCount; ++i) {
+		FREE(internal->linkedMeshes[i].parent);
+		FREE(internal->linkedMeshes[i].skin);
+	}
 	FREE(internal->linkedMeshes);
 	FREE(internal->linkedMeshes);
 	FREE(self->error);
 	FREE(self->error);
 	FREE(self);
 	FREE(self);
@@ -659,7 +664,7 @@ spAttachment* spSkeletonBinary_readAttachment(spSkeletonBinary* self, _dataInput
 	int freeName = name != 0;
 	int freeName = name != 0;
 	if (!name) {
 	if (!name) {
 		freeName = 0;
 		freeName = 0;
-		MALLOC_STR(name, attachmentName);
+		name = attachmentName;
 	}
 	}
 
 
 	type = (spAttachmentType)readByte(input);
 	type = (spAttachmentType)readByte(input);
@@ -1011,7 +1016,9 @@ spSkeletonData* spSkeletonBinary_readSkeletonData (spSkeletonBinary* self, const
 	skeletonData->animationsCount = readVarint(input, 1);
 	skeletonData->animationsCount = readVarint(input, 1);
 	skeletonData->animations = MALLOC(spAnimation*, skeletonData->animationsCount);
 	skeletonData->animations = MALLOC(spAnimation*, skeletonData->animationsCount);
 	for (i = 0; i < skeletonData->animationsCount; ++i) {
 	for (i = 0; i < skeletonData->animationsCount; ++i) {
-		spAnimation* animation = _spSkeletonBinary_readAnimation(self, readString(input), input, skeletonData);
+		const char* name = readString(input);
+		spAnimation* animation = _spSkeletonBinary_readAnimation(self, name, input, skeletonData);
+		FREE(name);
 		if (!animation) {
 		if (!animation) {
 			FREE(input);
 			FREE(input);
 			spSkeletonData_dispose(skeletonData);
 			spSkeletonData_dispose(skeletonData);

+ 11 - 0
spine-c/src/spine/SkeletonJson.c

@@ -37,6 +37,10 @@
 #include <spine/AtlasAttachmentLoader.h>
 #include <spine/AtlasAttachmentLoader.h>
 #include <spine/Animation.h>
 #include <spine/Animation.h>
 
 
+#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
+#define strdup _strdup
+#endif
+
 typedef struct {
 typedef struct {
 	const char* parent;
 	const char* parent;
 	const char* skin;
 	const char* skin;
@@ -569,11 +573,18 @@ spSkeletonData* spSkeletonJson_readSkeletonData (spSkeletonJson* self, const cha
 	CONST_CAST(char*, self->error) = 0;
 	CONST_CAST(char*, self->error) = 0;
 	internal->linkedMeshCount = 0;
 	internal->linkedMeshCount = 0;
 
 
+#ifndef __ANDROID__
 	oldLocale = strdup(setlocale(LC_NUMERIC, NULL));
 	oldLocale = strdup(setlocale(LC_NUMERIC, NULL));
 	setlocale(LC_NUMERIC, "C");
 	setlocale(LC_NUMERIC, "C");
+#endif
+    
 	root = Json_create(json);
 	root = Json_create(json);
+    
+#ifndef __ANDROID__
 	setlocale(LC_NUMERIC, oldLocale);
 	setlocale(LC_NUMERIC, oldLocale);
 	free(oldLocale);
 	free(oldLocale);
+#endif
+    
 	if (!root) {
 	if (!root) {
 		_spSkeletonJson_setError(self, 0, "Invalid skeleton JSON: ", Json_getError());
 		_spSkeletonJson_setError(self, 0, "Invalid skeleton JSON: ", Json_getError());
 		return 0;
 		return 0;

+ 1 - 1
spine-cocos2dx/example/Classes/GoblinsExample.cpp

@@ -44,7 +44,7 @@ Scene* GoblinsExample::scene () {
 bool GoblinsExample::init () {
 bool GoblinsExample::init () {
 	if (!LayerColor::initWithColor(Color4B(128, 128, 128, 255))) return false;
 	if (!LayerColor::initWithColor(Color4B(128, 128, 128, 255))) return false;
 
 
-	skeletonNode = SkeletonAnimation::createWithFile("goblins-mesh.json", "goblins.atlas", 1.5f);
+	skeletonNode = SkeletonAnimation::createWithJsonFile("goblins-mesh.json", "goblins.atlas", 1.5f);
 	skeletonNode->setAnimation(0, "walk", true);
 	skeletonNode->setAnimation(0, "walk", true);
 	skeletonNode->setSkin("goblin");
 	skeletonNode->setSkin("goblin");
 
 

+ 1 - 1
spine-cocos2dx/example/Classes/RaptorExample.cpp

@@ -44,7 +44,7 @@ Scene* RaptorExample::scene () {
 bool RaptorExample::init () {
 bool RaptorExample::init () {
 	if (!LayerColor::initWithColor(Color4B(128, 128, 128, 255))) return false;
 	if (!LayerColor::initWithColor(Color4B(128, 128, 128, 255))) return false;
 
 
-	skeletonNode = SkeletonAnimation::createWithFile("raptor.json", "raptor.atlas", 0.5f);
+	skeletonNode = SkeletonAnimation::createWithJsonFile("raptor.json", "raptor.atlas", 0.5f);
 	skeletonNode->setAnimation(0, "walk", true);
 	skeletonNode->setAnimation(0, "walk", true);
 	skeletonNode->setAnimation(1, "empty", false);
 	skeletonNode->setAnimation(1, "empty", false);
 	skeletonNode->addAnimation(1, "gungrab", false, 2);
 	skeletonNode->addAnimation(1, "gungrab", false, 2);

+ 1 - 1
spine-cocos2dx/example/Classes/SpineboyExample.cpp

@@ -44,7 +44,7 @@ Scene* SpineboyExample::scene () {
 bool SpineboyExample::init () {
 bool SpineboyExample::init () {
 	if (!LayerColor::initWithColor(Color4B(128, 128, 128, 255))) return false;
 	if (!LayerColor::initWithColor(Color4B(128, 128, 128, 255))) return false;
 
 
-	skeletonNode = SkeletonAnimation::createWithFile("spineboy.json", "spineboy.atlas", 0.6f);
+	skeletonNode = SkeletonAnimation::createWithJsonFile("spineboy.json", "spineboy.atlas", 0.6f);
 
 
 	skeletonNode->setStartListener( [this] (int trackIndex) {
 	skeletonNode->setStartListener( [this] (int trackIndex) {
 		spTrackEntry* entry = spAnimationState_getCurrent(skeletonNode->getState(), trackIndex);
 		spTrackEntry* entry = spAnimationState_getCurrent(skeletonNode->getState(), trackIndex);

+ 1 - 1
spine-cocos2dx/example/Classes/TankExample.cpp

@@ -44,7 +44,7 @@ Scene* TankExample::scene () {
 bool TankExample::init () {
 bool TankExample::init () {
 	if (!LayerColor::initWithColor(Color4B(128, 128, 128, 255))) return false;
 	if (!LayerColor::initWithColor(Color4B(128, 128, 128, 255))) return false;
 
 
-	skeletonNode = SkeletonAnimation::createWithFile("tank.json", "tank.atlas", 0.5f);
+	skeletonNode = SkeletonAnimation::createWithJsonFile("tank.json", "tank.atlas", 0.5f);
 	skeletonNode->setAnimation(0, "drive", true);
 	skeletonNode->setAnimation(0, "drive", true);
 
 
 	skeletonNode->setPosition(Vec2(_contentSize.width / 2 + 400, 20));
 	skeletonNode->setPosition(Vec2(_contentSize.width / 2 + 400, 20));

+ 8 - 0
spine-cocos2dx/example/proj.ios_mac/spine-cocos2d-x.xcodeproj/project.pbxproj

@@ -46,6 +46,8 @@
 		521A8E6519F0C34300D177D7 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 521A8E6319F0C34300D177D7 /* [email protected] */; };
 		521A8E6519F0C34300D177D7 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 521A8E6319F0C34300D177D7 /* [email protected] */; };
 		52B47A471A53D09C004E4C60 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52B47A461A53D09B004E4C60 /* Security.framework */; };
 		52B47A471A53D09C004E4C60 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52B47A461A53D09B004E4C60 /* Security.framework */; };
 		7602C5551D7DAA1300C7C674 /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7602C5541D7DAA1300C7C674 /* CoreText.framework */; };
 		7602C5551D7DAA1300C7C674 /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7602C5541D7DAA1300C7C674 /* CoreText.framework */; };
+		765B3E181DA283F90071C974 /* SkeletonBinary.c in Sources */ = {isa = PBXBuildFile; fileRef = 765B3E171DA283F90071C974 /* SkeletonBinary.c */; };
+		765B3E191DA284060071C974 /* SkeletonBinary.c in Sources */ = {isa = PBXBuildFile; fileRef = 765B3E171DA283F90071C974 /* SkeletonBinary.c */; };
 		76AAA3C01D180F7C00C54FCB /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA3B31D180F7C00C54FCB /* AppDelegate.cpp */; };
 		76AAA3C01D180F7C00C54FCB /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA3B31D180F7C00C54FCB /* AppDelegate.cpp */; };
 		76AAA3C11D180F7C00C54FCB /* BatchingExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA3B61D180F7C00C54FCB /* BatchingExample.cpp */; };
 		76AAA3C11D180F7C00C54FCB /* BatchingExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA3B61D180F7C00C54FCB /* BatchingExample.cpp */; };
 		76AAA3C21D180F7C00C54FCB /* GoblinsExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA3B81D180F7C00C54FCB /* GoblinsExample.cpp */; };
 		76AAA3C21D180F7C00C54FCB /* GoblinsExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA3B81D180F7C00C54FCB /* GoblinsExample.cpp */; };
@@ -244,6 +246,8 @@
 		521A8E6319F0C34300D177D7 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
 		521A8E6319F0C34300D177D7 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
 		52B47A461A53D09B004E4C60 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; };
 		52B47A461A53D09B004E4C60 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; };
 		7602C5541D7DAA1300C7C674 /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/Frameworks/CoreText.framework; sourceTree = DEVELOPER_DIR; };
 		7602C5541D7DAA1300C7C674 /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/Frameworks/CoreText.framework; sourceTree = DEVELOPER_DIR; };
+		765B3E161DA283F90071C974 /* kvec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = kvec.h; path = "../../../spine-c/src/spine/kvec.h"; sourceTree = "<group>"; };
+		765B3E171DA283F90071C974 /* SkeletonBinary.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SkeletonBinary.c; path = "../../../spine-c/src/spine/SkeletonBinary.c"; sourceTree = "<group>"; };
 		76AAA3B31D180F7C00C54FCB /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppDelegate.cpp; sourceTree = "<group>"; };
 		76AAA3B31D180F7C00C54FCB /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppDelegate.cpp; sourceTree = "<group>"; };
 		76AAA3B41D180F7C00C54FCB /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
 		76AAA3B41D180F7C00C54FCB /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
 		76AAA3B51D180F7C00C54FCB /* AppMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppMacros.h; sourceTree = "<group>"; };
 		76AAA3B51D180F7C00C54FCB /* AppMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppMacros.h; sourceTree = "<group>"; };
@@ -519,6 +523,8 @@
 		76AAA3B21D180F7300C54FCB /* spine */ = {
 		76AAA3B21D180F7300C54FCB /* spine */ = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
+				765B3E161DA283F90071C974 /* kvec.h */,
+				765B3E171DA283F90071C974 /* SkeletonBinary.c */,
 				76F5BCF41D2BB57F005917E5 /* Animation.c */,
 				76F5BCF41D2BB57F005917E5 /* Animation.c */,
 				76F5BCF51D2BB57F005917E5 /* AnimationState.c */,
 				76F5BCF51D2BB57F005917E5 /* AnimationState.c */,
 				76F5BCF61D2BB57F005917E5 /* AnimationStateData.c */,
 				76F5BCF61D2BB57F005917E5 /* AnimationStateData.c */,
@@ -741,6 +747,7 @@
 				76F5BD201D2BB57F005917E5 /* extension.c in Sources */,
 				76F5BD201D2BB57F005917E5 /* extension.c in Sources */,
 				76AAA3C01D180F7C00C54FCB /* AppDelegate.cpp in Sources */,
 				76AAA3C01D180F7C00C54FCB /* AppDelegate.cpp in Sources */,
 				76AAA3C41D180F7C00C54FCB /* SimpleCommand.cpp in Sources */,
 				76AAA3C41D180F7C00C54FCB /* SimpleCommand.cpp in Sources */,
+				765B3E181DA283F90071C974 /* SkeletonBinary.c in Sources */,
 				76F5BD261D2BB57F005917E5 /* PathConstraint.c in Sources */,
 				76F5BD261D2BB57F005917E5 /* PathConstraint.c in Sources */,
 				503AE10017EB989F00D1A890 /* AppController.mm in Sources */,
 				503AE10017EB989F00D1A890 /* AppController.mm in Sources */,
 				76AAA40E1D18106000C54FCB /* SkeletonAnimation.cpp in Sources */,
 				76AAA40E1D18106000C54FCB /* SkeletonAnimation.cpp in Sources */,
@@ -768,6 +775,7 @@
 			isa = PBXSourcesBuildPhase;
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			buildActionMask = 2147483647;
 			files = (
 			files = (
+				765B3E191DA284060071C974 /* SkeletonBinary.c in Sources */,
 				76F5BD561D2BD7EF005917E5 /* TankExample.cpp in Sources */,
 				76F5BD561D2BD7EF005917E5 /* TankExample.cpp in Sources */,
 				76F5BD571D2BD7EF005917E5 /* TankExample.h in Sources */,
 				76F5BD571D2BD7EF005917E5 /* TankExample.h in Sources */,
 				76F5BD331D2BD4A9005917E5 /* Animation.c in Sources */,
 				76F5BD331D2BD4A9005917E5 /* Animation.c in Sources */,

+ 31 - 24
spine-cocos2dx/src/spine/SkeletonAnimation.cpp

@@ -72,24 +72,46 @@ void disposeTrackEntry (spTrackEntry* entry) {
 //
 //
 
 
 SkeletonAnimation* SkeletonAnimation::createWithData (spSkeletonData* skeletonData, bool ownsSkeletonData) {
 SkeletonAnimation* SkeletonAnimation::createWithData (spSkeletonData* skeletonData, bool ownsSkeletonData) {
-	SkeletonAnimation* node = new SkeletonAnimation(skeletonData, ownsSkeletonData);
+	SkeletonAnimation* node = new SkeletonAnimation();
+	node->initWithData(skeletonData, ownsSkeletonData);
 	node->autorelease();
 	node->autorelease();
 	return node;
 	return node;
 }
 }
 
 
-SkeletonAnimation* SkeletonAnimation::createWithFile (const std::string& skeletonDataFile, spAtlas* atlas, float scale) {
-	SkeletonAnimation* node = new SkeletonAnimation(skeletonDataFile, atlas, scale);
+SkeletonAnimation* SkeletonAnimation::createWithJsonFile (const std::string& skeletonJsonFile, spAtlas* atlas, float scale) {
+	SkeletonAnimation* node = new SkeletonAnimation();
+	node->initWithJsonFile(skeletonJsonFile, atlas, scale);
 	node->autorelease();
 	node->autorelease();
 	return node;
 	return node;
 }
 }
 
 
-SkeletonAnimation* SkeletonAnimation::createWithFile (const std::string& skeletonDataFile, const std::string& atlasFile, float scale) {
-	SkeletonAnimation* node = new SkeletonAnimation(skeletonDataFile, atlasFile, scale);
+SkeletonAnimation* SkeletonAnimation::createWithJsonFile (const std::string& skeletonJsonFile, const std::string& atlasFile, float scale) {
+	SkeletonAnimation* node = new SkeletonAnimation();
+	spAtlas* atlas = spAtlas_createFromFile(atlasFile.c_str(), 0);
+	node->initWithJsonFile(skeletonJsonFile, atlas, scale);
 	node->autorelease();
 	node->autorelease();
 	return node;
 	return node;
 }
 }
 
 
+SkeletonAnimation* SkeletonAnimation::createWithBinaryFile (const std::string& skeletonBinaryFile, spAtlas* atlas, float scale) {
+	SkeletonAnimation* node = new SkeletonAnimation();
+	node->initWithBinaryFile(skeletonBinaryFile, atlas, scale);
+	node->autorelease();
+	return node;
+}
+
+SkeletonAnimation* SkeletonAnimation::createWithBinaryFile (const std::string& skeletonBinaryFile, const std::string& atlasFile, float scale) {
+	SkeletonAnimation* node = new SkeletonAnimation();
+	spAtlas* atlas = spAtlas_createFromFile(atlasFile.c_str(), 0);
+	node->initWithBinaryFile(skeletonBinaryFile, atlas, scale);
+	node->autorelease();
+	return node;
+}
+
+
 void SkeletonAnimation::initialize () {
 void SkeletonAnimation::initialize () {
+	super::initialize();
+
 	_ownsAnimationStateData = true;
 	_ownsAnimationStateData = true;
 	_state = spAnimationState_create(spAnimationStateData_create(_skeleton->data));
 	_state = spAnimationState_create(spAnimationStateData_create(_skeleton->data));
 	_state->rendererObject = this;
 	_state->rendererObject = this;
@@ -103,21 +125,6 @@ SkeletonAnimation::SkeletonAnimation ()
 		: SkeletonRenderer() {
 		: SkeletonRenderer() {
 }
 }
 
 
-SkeletonAnimation::SkeletonAnimation (spSkeletonData *skeletonData, bool ownsSkeletonData)
-		: SkeletonRenderer(skeletonData, ownsSkeletonData) {
-	initialize();
-}
-
-SkeletonAnimation::SkeletonAnimation (const std::string& skeletonDataFile, spAtlas* atlas, float scale)
-		: SkeletonRenderer(skeletonDataFile, atlas, scale) {
-	initialize();
-}
-
-SkeletonAnimation::SkeletonAnimation (const std::string& skeletonDataFile, const std::string& atlasFile, float scale)
-		: SkeletonRenderer(skeletonDataFile, atlasFile, scale) {
-	initialize();
-}
-
 SkeletonAnimation::~SkeletonAnimation () {
 SkeletonAnimation::~SkeletonAnimation () {
 	if (_ownsAnimationStateData) spAnimationStateData_dispose(_state->data);
 	if (_ownsAnimationStateData) spAnimationStateData_dispose(_state->data);
 	spAnimationState_dispose(_state);
 	spAnimationState_dispose(_state);
@@ -135,8 +142,8 @@ void SkeletonAnimation::update (float deltaTime) {
 void SkeletonAnimation::setAnimationStateData (spAnimationStateData* stateData) {
 void SkeletonAnimation::setAnimationStateData (spAnimationStateData* stateData) {
 	CCASSERT(stateData, "stateData cannot be null.");
 	CCASSERT(stateData, "stateData cannot be null.");
 
 
-	if (_ownsAnimationStateData) spAnimationStateData_dispose(_state->data);
-	spAnimationState_dispose(_state);
+    if (_ownsAnimationStateData) spAnimationStateData_dispose(_state->data);
+    spAnimationState_dispose(_state);
 
 
 	_ownsAnimationStateData = false;
 	_ownsAnimationStateData = false;
 	_state = spAnimationState_create(stateData);
 	_state = spAnimationState_create(stateData);
@@ -165,9 +172,9 @@ spTrackEntry* SkeletonAnimation::addAnimation (int trackIndex, const std::string
 	}
 	}
 	return spAnimationState_addAnimation(_state, trackIndex, animation, loop, delay);
 	return spAnimationState_addAnimation(_state, trackIndex, animation, loop, delay);
 }
 }
-    
+	
 spAnimation* SkeletonAnimation::findAnimation(const std::string& name) const {
 spAnimation* SkeletonAnimation::findAnimation(const std::string& name) const {
-    return spSkeletonData_findAnimation(_skeleton->data, name.c_str());
+	return spSkeletonData_findAnimation(_skeleton->data, name.c_str());
 }
 }
 
 
 spTrackEntry* SkeletonAnimation::getCurrent (int trackIndex) { 
 spTrackEntry* SkeletonAnimation::getCurrent (int trackIndex) { 

+ 19 - 9
spine-cocos2dx/src/spine/SkeletonAnimation.h

@@ -49,17 +49,30 @@ class SkeletonAnimation: public SkeletonRenderer {
 public:
 public:
 	CREATE_FUNC(SkeletonAnimation);
 	CREATE_FUNC(SkeletonAnimation);
 	static SkeletonAnimation* createWithData (spSkeletonData* skeletonData, bool ownsSkeletonData = false);
 	static SkeletonAnimation* createWithData (spSkeletonData* skeletonData, bool ownsSkeletonData = false);
-	static SkeletonAnimation* createWithFile (const std::string& skeletonDataFile, spAtlas* atlas, float scale = 1);
-	static SkeletonAnimation* createWithFile (const std::string& skeletonDataFile, const std::string& atlasFile, float scale = 1);
-
-	virtual void update (float deltaTime);
+	static SkeletonAnimation* createWithJsonFile (const std::string& skeletonJsonFile, spAtlas* atlas, float scale = 1);
+	static SkeletonAnimation* createWithJsonFile (const std::string& skeletonJsonFile, const std::string& atlasFile, float scale = 1);
+	static SkeletonAnimation* createWithBinaryFile (const std::string& skeletonBinaryFile, spAtlas* atlas, float scale = 1);
+	static SkeletonAnimation* createWithBinaryFile (const std::string& skeletonBinaryFile, const std::string& atlasFile, float scale = 1);
+
+	// Use createWithJsonFile instead
+	CC_DEPRECATED_ATTRIBUTE static SkeletonAnimation* createWithFile (const std::string& skeletonJsonFile, spAtlas* atlas, float scale = 1)
+	{
+		return SkeletonAnimation::createWithJsonFile(skeletonJsonFile, atlas, scale);
+	}
+	// Use createWithJsonFile instead
+	CC_DEPRECATED_ATTRIBUTE static SkeletonAnimation* createWithile (const std::string& skeletonJsonFile, const std::string& atlasFile, float scale = 1)
+	{
+		return SkeletonAnimation::createWithJsonFile(skeletonJsonFile, atlasFile, scale);
+	}
+
+	virtual void update (float deltaTime) override;
 
 
 	void setAnimationStateData (spAnimationStateData* stateData);
 	void setAnimationStateData (spAnimationStateData* stateData);
 	void setMix (const std::string& fromAnimation, const std::string& toAnimation, float duration);
 	void setMix (const std::string& fromAnimation, const std::string& toAnimation, float duration);
 
 
 	spTrackEntry* setAnimation (int trackIndex, const std::string& name, bool loop);
 	spTrackEntry* setAnimation (int trackIndex, const std::string& name, bool loop);
 	spTrackEntry* addAnimation (int trackIndex, const std::string& name, bool loop, float delay = 0);
 	spTrackEntry* addAnimation (int trackIndex, const std::string& name, bool loop, float delay = 0);
-    spAnimation* findAnimation(const std::string& name) const;
+	spAnimation* findAnimation(const std::string& name) const;
 	spTrackEntry* getCurrent (int trackIndex = 0);
 	spTrackEntry* getCurrent (int trackIndex = 0);
 	void clearTracks ();
 	void clearTracks ();
 	void clearTrack (int trackIndex = 0);
 	void clearTrack (int trackIndex = 0);
@@ -81,11 +94,8 @@ public:
 
 
 CC_CONSTRUCTOR_ACCESS:
 CC_CONSTRUCTOR_ACCESS:
 	SkeletonAnimation ();
 	SkeletonAnimation ();
-	SkeletonAnimation (spSkeletonData* skeletonData, bool ownsSkeletonData = false);
-	SkeletonAnimation (const std::string&skeletonDataFile, spAtlas* atlas, float scale = 1);
-	SkeletonAnimation (const std::string& skeletonDataFile, const std::string& atlasFile, float scale = 1);
 	virtual ~SkeletonAnimation ();
 	virtual ~SkeletonAnimation ();
-	void initialize ();
+	virtual void initialize () override;
 
 
 protected:
 protected:
 	spAnimationState* _state;
 	spAnimationState* _state;

+ 23 - 14
spine-cocos2dx/src/spine/SkeletonBatch.cpp

@@ -38,34 +38,34 @@ USING_NS_CC;
 using std::max;
 using std::max;
 
 
 namespace spine {
 namespace spine {
-    
+
     static SkeletonBatch* instance = nullptr;
     static SkeletonBatch* instance = nullptr;
-    
+
     SkeletonBatch* SkeletonBatch::getInstance () {
     SkeletonBatch* SkeletonBatch::getInstance () {
         if (!instance) instance = new SkeletonBatch();
         if (!instance) instance = new SkeletonBatch();
         return instance;
         return instance;
     }
     }
-    
+
     void SkeletonBatch::destroyInstance () {
     void SkeletonBatch::destroyInstance () {
         if (instance) {
         if (instance) {
             delete instance;
             delete instance;
             instance = nullptr;
             instance = nullptr;
         }
         }
     }
     }
-    
+
     SkeletonBatch::SkeletonBatch ()
     SkeletonBatch::SkeletonBatch ()
     {
     {
         _firstCommand = new Command();
         _firstCommand = new Command();
         _command = _firstCommand;
         _command = _firstCommand;
-        
+
         Director::getInstance()->getEventDispatcher()->addCustomEventListener(EVENT_AFTER_DRAW_RESET_POSITION, [this](EventCustom* eventCustom){
         Director::getInstance()->getEventDispatcher()->addCustomEventListener(EVENT_AFTER_DRAW_RESET_POSITION, [this](EventCustom* eventCustom){
             this->update(0);
             this->update(0);
         });;
         });;
     }
     }
-    
+
     SkeletonBatch::~SkeletonBatch () {
     SkeletonBatch::~SkeletonBatch () {
         Director::getInstance()->getEventDispatcher()->removeCustomEventListeners(EVENT_AFTER_DRAW_RESET_POSITION);
         Director::getInstance()->getEventDispatcher()->removeCustomEventListeners(EVENT_AFTER_DRAW_RESET_POSITION);
-        
+
         Command* command = _firstCommand;
         Command* command = _firstCommand;
         while (command) {
         while (command) {
             Command* next = command->next;
             Command* next = command->next;
@@ -73,15 +73,21 @@ namespace spine {
             command = next;
             command = next;
         }
         }
     }
     }
-    
+
     void SkeletonBatch::update (float delta) {
     void SkeletonBatch::update (float delta) {
         _command = _firstCommand;
         _command = _firstCommand;
     }
     }
-    
+
     void SkeletonBatch::addCommand (cocos2d::Renderer* renderer, float globalZOrder, GLuint textureID, GLProgramState* glProgramState,
     void SkeletonBatch::addCommand (cocos2d::Renderer* renderer, float globalZOrder, GLuint textureID, GLProgramState* glProgramState,
                                     BlendFunc blendFunc, const TrianglesCommand::Triangles& triangles, const Mat4& transform, uint32_t transformFlags
                                     BlendFunc blendFunc, const TrianglesCommand::Triangles& triangles, const Mat4& transform, uint32_t transformFlags
                                     ) {
                                     ) {
-        _command->triangles->verts = triangles.verts;
+        if (_command->triangles->verts) {
+            free(_command->triangles->verts);
+            _command->triangles->verts = NULL;
+        }
+        
+        _command->triangles->verts = (V3F_C4B_T2F *)malloc(sizeof(V3F_C4B_T2F) * triangles.vertCount);
+        memcpy(_command->triangles->verts, triangles.verts, sizeof(V3F_C4B_T2F) * triangles.vertCount);
         
         
         _command->triangles->vertCount = triangles.vertCount;
         _command->triangles->vertCount = triangles.vertCount;
         _command->triangles->indexCount = triangles.indexCount;
         _command->triangles->indexCount = triangles.indexCount;
@@ -93,17 +99,20 @@ namespace spine {
         if (!_command->next) _command->next = new Command();
         if (!_command->next) _command->next = new Command();
         _command = _command->next;
         _command = _command->next;
     }
     }
-    
+
     SkeletonBatch::Command::Command () :
     SkeletonBatch::Command::Command () :
     next(nullptr)
     next(nullptr)
     {
     {
         trianglesCommand = new TrianglesCommand();
         trianglesCommand = new TrianglesCommand();
         triangles = new TrianglesCommand::Triangles();
         triangles = new TrianglesCommand::Triangles();
     }
     }
-    
+
     SkeletonBatch::Command::~Command () {
     SkeletonBatch::Command::~Command () {
+        if (triangles->verts) {
+            free(triangles->verts);
+        }
         delete triangles;
         delete triangles;
         delete trianglesCommand;
         delete trianglesCommand;
     }
     }
-    
-}
+
+}

+ 37 - 5
spine-cocos2dx/src/spine/SkeletonRenderer.cpp

@@ -85,12 +85,12 @@ SkeletonRenderer::SkeletonRenderer (spSkeletonData *skeletonData, bool ownsSkele
 
 
 SkeletonRenderer::SkeletonRenderer (const std::string& skeletonDataFile, spAtlas* atlas, float scale)
 SkeletonRenderer::SkeletonRenderer (const std::string& skeletonDataFile, spAtlas* atlas, float scale)
 	: _atlas(nullptr), _attachmentLoader(nullptr), _debugSlots(false), _debugBones(false), _timeScale(1) {
 	: _atlas(nullptr), _attachmentLoader(nullptr), _debugSlots(false), _debugBones(false), _timeScale(1) {
-	initWithFile(skeletonDataFile, atlas, scale);
+	initWithJsonFile(skeletonDataFile, atlas, scale);
 }
 }
 
 
 SkeletonRenderer::SkeletonRenderer (const std::string& skeletonDataFile, const std::string& atlasFile, float scale)
 SkeletonRenderer::SkeletonRenderer (const std::string& skeletonDataFile, const std::string& atlasFile, float scale)
 	: _atlas(nullptr), _attachmentLoader(nullptr), _debugSlots(false), _debugBones(false), _timeScale(1) {
 	: _atlas(nullptr), _attachmentLoader(nullptr), _debugSlots(false), _debugBones(false), _timeScale(1) {
-	initWithFile(skeletonDataFile, atlasFile, scale);
+	initWithJsonFile(skeletonDataFile, atlasFile, scale);
 }
 }
 
 
 SkeletonRenderer::~SkeletonRenderer () {
 SkeletonRenderer::~SkeletonRenderer () {
@@ -98,7 +98,7 @@ SkeletonRenderer::~SkeletonRenderer () {
 	spSkeleton_dispose(_skeleton);
 	spSkeleton_dispose(_skeleton);
 	if (_atlas) spAtlas_dispose(_atlas);
 	if (_atlas) spAtlas_dispose(_atlas);
 	if (_attachmentLoader) spAttachmentLoader_dispose(_attachmentLoader);
 	if (_attachmentLoader) spAttachmentLoader_dispose(_attachmentLoader);
-	delete _worldVertices;
+	delete [] _worldVertices;
 }
 }
 
 
 void SkeletonRenderer::initWithData (spSkeletonData* skeletonData, bool ownsSkeletonData) {
 void SkeletonRenderer::initWithData (spSkeletonData* skeletonData, bool ownsSkeletonData) {
@@ -107,7 +107,7 @@ void SkeletonRenderer::initWithData (spSkeletonData* skeletonData, bool ownsSkel
 	initialize();
 	initialize();
 }
 }
 
 
-void SkeletonRenderer::initWithFile (const std::string& skeletonDataFile, spAtlas* atlas, float scale) {
+void SkeletonRenderer::initWithJsonFile (const std::string& skeletonDataFile, spAtlas* atlas, float scale) {
     _atlas = atlas;
     _atlas = atlas;
 	_attachmentLoader = SUPER(Cocos2dAttachmentLoader_create(_atlas));
 	_attachmentLoader = SUPER(Cocos2dAttachmentLoader_create(_atlas));
 
 
@@ -122,7 +122,7 @@ void SkeletonRenderer::initWithFile (const std::string& skeletonDataFile, spAtla
 	initialize();
 	initialize();
 }
 }
 
 
-void SkeletonRenderer::initWithFile (const std::string& skeletonDataFile, const std::string& atlasFile, float scale) {
+void SkeletonRenderer::initWithJsonFile (const std::string& skeletonDataFile, const std::string& atlasFile, float scale) {
 	_atlas = spAtlas_createFromFile(atlasFile.c_str(), 0);
 	_atlas = spAtlas_createFromFile(atlasFile.c_str(), 0);
 	CCASSERT(_atlas, "Error reading atlas file.");
 	CCASSERT(_atlas, "Error reading atlas file.");
 
 
@@ -138,6 +138,38 @@ void SkeletonRenderer::initWithFile (const std::string& skeletonDataFile, const
 
 
 	initialize();
 	initialize();
 }
 }
+    
+void SkeletonRenderer::initWithBinaryFile (const std::string& skeletonDataFile, spAtlas* atlas, float scale) {
+    _atlas = atlas;
+    _attachmentLoader = SUPER(Cocos2dAttachmentLoader_create(_atlas));
+    
+    spSkeletonBinary* binary = spSkeletonBinary_createWithLoader(_attachmentLoader);
+    binary->scale = scale;
+    spSkeletonData* skeletonData = spSkeletonBinary_readSkeletonDataFile(binary, skeletonDataFile.c_str());
+    CCASSERT(skeletonData, binary->error ? binary->error : "Error reading skeleton data file.");
+    spSkeletonBinary_dispose(binary);
+    
+    setSkeletonData(skeletonData, true);
+    
+    initialize();
+}
+
+void SkeletonRenderer::initWithBinaryFile (const std::string& skeletonDataFile, const std::string& atlasFile, float scale) {
+    _atlas = spAtlas_createFromFile(atlasFile.c_str(), 0);
+    CCASSERT(_atlas, "Error reading atlas file.");
+    
+    _attachmentLoader = SUPER(Cocos2dAttachmentLoader_create(_atlas));
+    
+    spSkeletonBinary* binary = spSkeletonBinary_createWithLoader(_attachmentLoader);
+    binary->scale = scale;
+    spSkeletonData* skeletonData = spSkeletonBinary_readSkeletonDataFile(binary, skeletonDataFile.c_str());
+    CCASSERT(skeletonData, binary->error ? binary->error : "Error reading skeleton data file.");
+    spSkeletonBinary_dispose(binary);
+    
+    setSkeletonData(skeletonData, true);
+    
+    initialize();
+}
 
 
 
 
 void SkeletonRenderer::update (float deltaTime) {
 void SkeletonRenderer::update (float deltaTime) {

+ 5 - 3
spine-cocos2dx/src/spine/SkeletonRenderer.h

@@ -108,10 +108,12 @@ CC_CONSTRUCTOR_ACCESS:
 	virtual ~SkeletonRenderer ();
 	virtual ~SkeletonRenderer ();
 
 
 	void initWithData (spSkeletonData* skeletonData, bool ownsSkeletonData = false);
 	void initWithData (spSkeletonData* skeletonData, bool ownsSkeletonData = false);
-	void initWithFile (const std::string& skeletonDataFile, spAtlas* atlas, float scale = 1);
-	void initWithFile (const std::string& skeletonDataFile, const std::string& atlasFile, float scale = 1);
+	void initWithJsonFile (const std::string& skeletonDataFile, spAtlas* atlas, float scale = 1);
+	void initWithJsonFile (const std::string& skeletonDataFile, const std::string& atlasFile, float scale = 1);
+    void initWithBinaryFile (const std::string& skeletonDataFile, spAtlas* atlas, float scale = 1);
+    void initWithBinaryFile (const std::string& skeletonDataFile, const std::string& atlasFile, float scale = 1);
 
 
-	void initialize ();
+	virtual void initialize ();
 
 
 protected:
 protected:
 	void setSkeletonData (spSkeletonData* skeletonData, bool ownsSkeletonData);
 	void setSkeletonData (spSkeletonData* skeletonData, bool ownsSkeletonData);

BIN
spine-starling/spine-starling-example/lib/spine-as3.swc


BIN
spine-starling/spine-starling/lib/spine-as3.swc


+ 133 - 129
spine-ts/build/spine-all.d.ts

@@ -322,6 +322,135 @@ declare module spine {
 		getMix(from: Animation, to: Animation): number;
 		getMix(from: Animation, to: Animation): number;
 	}
 	}
 }
 }
+declare module spine {
+	abstract class Attachment {
+		name: string;
+		constructor(name: string);
+	}
+	abstract class VertexAttachment extends Attachment {
+		bones: Array<number>;
+		vertices: ArrayLike<number>;
+		worldVerticesLength: number;
+		constructor(name: string);
+		computeWorldVertices(slot: Slot, worldVertices: ArrayLike<number>): void;
+		computeWorldVerticesWith(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number): void;
+		applyDeform(sourceAttachment: VertexAttachment): boolean;
+	}
+}
+declare module spine {
+	interface AttachmentLoader {
+		newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
+		newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
+		newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
+		newPathAttachment(skin: Skin, name: string): PathAttachment;
+	}
+}
+declare module spine {
+	enum AttachmentType {
+		Region = 0,
+		BoundingBox = 1,
+		Mesh = 2,
+		LinkedMesh = 3,
+		Path = 4,
+	}
+}
+declare module spine {
+	class BoundingBoxAttachment extends VertexAttachment {
+		color: Color;
+		constructor(name: string);
+	}
+}
+declare module spine {
+	class MeshAttachment extends VertexAttachment {
+		region: TextureRegion;
+		path: string;
+		regionUVs: ArrayLike<number>;
+		worldVertices: ArrayLike<number>;
+		triangles: Array<number>;
+		color: Color;
+		hullLength: number;
+		private parentMesh;
+		inheritDeform: boolean;
+		tempColor: Color;
+		constructor(name: string);
+		updateUVs(): void;
+		updateWorldVertices(slot: Slot, premultipliedAlpha: boolean): ArrayLike<number>;
+		applyDeform(sourceAttachment: VertexAttachment): boolean;
+		getParentMesh(): MeshAttachment;
+		setParentMesh(parentMesh: MeshAttachment): void;
+	}
+}
+declare module spine {
+	class PathAttachment extends VertexAttachment {
+		lengths: Array<number>;
+		closed: boolean;
+		constantSpeed: boolean;
+		color: Color;
+		constructor(name: string);
+	}
+}
+declare module spine {
+	class RegionAttachment extends Attachment {
+		static OX1: number;
+		static OY1: number;
+		static OX2: number;
+		static OY2: number;
+		static OX3: number;
+		static OY3: number;
+		static OX4: number;
+		static OY4: number;
+		static X1: number;
+		static Y1: number;
+		static C1R: number;
+		static C1G: number;
+		static C1B: number;
+		static C1A: number;
+		static U1: number;
+		static V1: number;
+		static X2: number;
+		static Y2: number;
+		static C2R: number;
+		static C2G: number;
+		static C2B: number;
+		static C2A: number;
+		static U2: number;
+		static V2: number;
+		static X3: number;
+		static Y3: number;
+		static C3R: number;
+		static C3G: number;
+		static C3B: number;
+		static C3A: number;
+		static U3: number;
+		static V3: number;
+		static X4: number;
+		static Y4: number;
+		static C4R: number;
+		static C4G: number;
+		static C4B: number;
+		static C4A: number;
+		static U4: number;
+		static V4: number;
+		x: number;
+		y: number;
+		scaleX: number;
+		scaleY: number;
+		rotation: number;
+		width: number;
+		height: number;
+		color: Color;
+		path: string;
+		rendererObject: any;
+		region: TextureRegion;
+		offset: ArrayLike<number>;
+		vertices: ArrayLike<number>;
+		tempColor: Color;
+		constructor(name: string);
+		setRegion(region: TextureRegion): void;
+		updateOffset(): void;
+		updateWorldVertices(slot: Slot, premultipliedAlpha: boolean): ArrayLike<number>;
+	}
+}
 declare module spine {
 declare module spine {
 	enum BlendMode {
 	enum BlendMode {
 		Normal = 0,
 		Normal = 0,
@@ -783,7 +912,7 @@ declare module spine {
 		static setArraySize<T>(array: Array<T>, size: number, value?: any): Array<T>;
 		static setArraySize<T>(array: Array<T>, size: number, value?: any): Array<T>;
 		static newArray<T>(size: number, defaultValue: T): Array<T>;
 		static newArray<T>(size: number, defaultValue: T): Array<T>;
 		static newFloatArray(size: number): ArrayLike<number>;
 		static newFloatArray(size: number): ArrayLike<number>;
-		static toFloatArray(array: Array<number>): Float32Array | number[];
+		static toFloatArray(array: Array<number>): number[] | Float32Array;
 	}
 	}
 	class DebugUtils {
 	class DebugUtils {
 		static logBones(skeleton: Skeleton): void;
 		static logBones(skeleton: Skeleton): void;
@@ -815,134 +944,9 @@ declare module spine {
 		private frameTime;
 		private frameTime;
 		update(): void;
 		update(): void;
 	}
 	}
-}
-declare module spine {
-	abstract class Attachment {
-		name: string;
-		constructor(name: string);
-	}
-	abstract class VertexAttachment extends Attachment {
-		bones: Array<number>;
-		vertices: ArrayLike<number>;
-		worldVerticesLength: number;
-		constructor(name: string);
-		computeWorldVertices(slot: Slot, worldVertices: ArrayLike<number>): void;
-		computeWorldVerticesWith(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number): void;
-		applyDeform(sourceAttachment: VertexAttachment): boolean;
-	}
-}
-declare module spine {
-	interface AttachmentLoader {
-		newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
-		newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
-		newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
-		newPathAttachment(skin: Skin, name: string): PathAttachment;
-	}
-}
-declare module spine {
-	enum AttachmentType {
-		Region = 0,
-		BoundingBox = 1,
-		Mesh = 2,
-		LinkedMesh = 3,
-		Path = 4,
-	}
-}
-declare module spine {
-	class BoundingBoxAttachment extends VertexAttachment {
-		color: Color;
-		constructor(name: string);
-	}
-}
-declare module spine {
-	class MeshAttachment extends VertexAttachment {
-		region: TextureRegion;
-		path: string;
-		regionUVs: ArrayLike<number>;
-		worldVertices: ArrayLike<number>;
-		triangles: Array<number>;
-		color: Color;
-		hullLength: number;
-		private parentMesh;
-		inheritDeform: boolean;
-		tempColor: Color;
-		constructor(name: string);
-		updateUVs(): void;
-		updateWorldVertices(slot: Slot, premultipliedAlpha: boolean): ArrayLike<number>;
-		applyDeform(sourceAttachment: VertexAttachment): boolean;
-		getParentMesh(): MeshAttachment;
-		setParentMesh(parentMesh: MeshAttachment): void;
-	}
-}
-declare module spine {
-	class PathAttachment extends VertexAttachment {
-		lengths: Array<number>;
-		closed: boolean;
-		constantSpeed: boolean;
-		color: Color;
-		constructor(name: string);
-	}
-}
-declare module spine {
-	class RegionAttachment extends Attachment {
-		static OX1: number;
-		static OY1: number;
-		static OX2: number;
-		static OY2: number;
-		static OX3: number;
-		static OY3: number;
-		static OX4: number;
-		static OY4: number;
-		static X1: number;
-		static Y1: number;
-		static C1R: number;
-		static C1G: number;
-		static C1B: number;
-		static C1A: number;
-		static U1: number;
-		static V1: number;
-		static X2: number;
-		static Y2: number;
-		static C2R: number;
-		static C2G: number;
-		static C2B: number;
-		static C2A: number;
-		static U2: number;
-		static V2: number;
-		static X3: number;
-		static Y3: number;
-		static C3R: number;
-		static C3G: number;
-		static C3B: number;
-		static C3A: number;
-		static U3: number;
-		static V3: number;
-		static X4: number;
-		static Y4: number;
-		static C4R: number;
-		static C4G: number;
-		static C4B: number;
-		static C4A: number;
-		static U4: number;
-		static V4: number;
-		x: number;
-		y: number;
-		scaleX: number;
-		scaleY: number;
-		rotation: number;
-		width: number;
-		height: number;
-		color: Color;
-		path: string;
-		rendererObject: any;
-		region: TextureRegion;
-		offset: ArrayLike<number>;
-		vertices: ArrayLike<number>;
-		tempColor: Color;
-		constructor(name: string);
-		setRegion(region: TextureRegion): void;
-		updateOffset(): void;
-		updateWorldVertices(slot: Slot, premultipliedAlpha: boolean): ArrayLike<number>;
+	interface ArrayLike<T> {
+		length: number;
+		[n: number]: T;
 	}
 	}
 }
 }
 declare module spine.threejs {
 declare module spine.threejs {

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 558 - 553
spine-ts/build/spine-all.js


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
spine-ts/build/spine-all.js.map


+ 133 - 129
spine-ts/build/spine-core.d.ts

@@ -256,6 +256,135 @@ declare module spine {
 		getErrors(): Map<string>;
 		getErrors(): Map<string>;
 	}
 	}
 }
 }
+declare module spine {
+	abstract class Attachment {
+		name: string;
+		constructor(name: string);
+	}
+	abstract class VertexAttachment extends Attachment {
+		bones: Array<number>;
+		vertices: ArrayLike<number>;
+		worldVerticesLength: number;
+		constructor(name: string);
+		computeWorldVertices(slot: Slot, worldVertices: ArrayLike<number>): void;
+		computeWorldVerticesWith(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number): void;
+		applyDeform(sourceAttachment: VertexAttachment): boolean;
+	}
+}
+declare module spine {
+	interface AttachmentLoader {
+		newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
+		newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
+		newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
+		newPathAttachment(skin: Skin, name: string): PathAttachment;
+	}
+}
+declare module spine {
+	enum AttachmentType {
+		Region = 0,
+		BoundingBox = 1,
+		Mesh = 2,
+		LinkedMesh = 3,
+		Path = 4,
+	}
+}
+declare module spine {
+	class BoundingBoxAttachment extends VertexAttachment {
+		color: Color;
+		constructor(name: string);
+	}
+}
+declare module spine {
+	class MeshAttachment extends VertexAttachment {
+		region: TextureRegion;
+		path: string;
+		regionUVs: ArrayLike<number>;
+		worldVertices: ArrayLike<number>;
+		triangles: Array<number>;
+		color: Color;
+		hullLength: number;
+		private parentMesh;
+		inheritDeform: boolean;
+		tempColor: Color;
+		constructor(name: string);
+		updateUVs(): void;
+		updateWorldVertices(slot: Slot, premultipliedAlpha: boolean): ArrayLike<number>;
+		applyDeform(sourceAttachment: VertexAttachment): boolean;
+		getParentMesh(): MeshAttachment;
+		setParentMesh(parentMesh: MeshAttachment): void;
+	}
+}
+declare module spine {
+	class PathAttachment extends VertexAttachment {
+		lengths: Array<number>;
+		closed: boolean;
+		constantSpeed: boolean;
+		color: Color;
+		constructor(name: string);
+	}
+}
+declare module spine {
+	class RegionAttachment extends Attachment {
+		static OX1: number;
+		static OY1: number;
+		static OX2: number;
+		static OY2: number;
+		static OX3: number;
+		static OY3: number;
+		static OX4: number;
+		static OY4: number;
+		static X1: number;
+		static Y1: number;
+		static C1R: number;
+		static C1G: number;
+		static C1B: number;
+		static C1A: number;
+		static U1: number;
+		static V1: number;
+		static X2: number;
+		static Y2: number;
+		static C2R: number;
+		static C2G: number;
+		static C2B: number;
+		static C2A: number;
+		static U2: number;
+		static V2: number;
+		static X3: number;
+		static Y3: number;
+		static C3R: number;
+		static C3G: number;
+		static C3B: number;
+		static C3A: number;
+		static U3: number;
+		static V3: number;
+		static X4: number;
+		static Y4: number;
+		static C4R: number;
+		static C4G: number;
+		static C4B: number;
+		static C4A: number;
+		static U4: number;
+		static V4: number;
+		x: number;
+		y: number;
+		scaleX: number;
+		scaleY: number;
+		rotation: number;
+		width: number;
+		height: number;
+		color: Color;
+		path: string;
+		rendererObject: any;
+		region: TextureRegion;
+		offset: ArrayLike<number>;
+		vertices: ArrayLike<number>;
+		tempColor: Color;
+		constructor(name: string);
+		setRegion(region: TextureRegion): void;
+		updateOffset(): void;
+		updateWorldVertices(slot: Slot, premultipliedAlpha: boolean): ArrayLike<number>;
+	}
+}
 declare module spine {
 declare module spine {
 	enum BlendMode {
 	enum BlendMode {
 		Normal = 0,
 		Normal = 0,
@@ -757,7 +886,7 @@ declare module spine {
 		static setArraySize<T>(array: Array<T>, size: number, value?: any): Array<T>;
 		static setArraySize<T>(array: Array<T>, size: number, value?: any): Array<T>;
 		static newArray<T>(size: number, defaultValue: T): Array<T>;
 		static newArray<T>(size: number, defaultValue: T): Array<T>;
 		static newFloatArray(size: number): ArrayLike<number>;
 		static newFloatArray(size: number): ArrayLike<number>;
-		static toFloatArray(array: Array<number>): Float32Array | number[];
+		static toFloatArray(array: Array<number>): number[] | Float32Array;
 	}
 	}
 	class DebugUtils {
 	class DebugUtils {
 		static logBones(skeleton: Skeleton): void;
 		static logBones(skeleton: Skeleton): void;
@@ -789,133 +918,8 @@ declare module spine {
 		private frameTime;
 		private frameTime;
 		update(): void;
 		update(): void;
 	}
 	}
-}
-declare module spine {
-	abstract class Attachment {
-		name: string;
-		constructor(name: string);
-	}
-	abstract class VertexAttachment extends Attachment {
-		bones: Array<number>;
-		vertices: ArrayLike<number>;
-		worldVerticesLength: number;
-		constructor(name: string);
-		computeWorldVertices(slot: Slot, worldVertices: ArrayLike<number>): void;
-		computeWorldVerticesWith(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number): void;
-		applyDeform(sourceAttachment: VertexAttachment): boolean;
-	}
-}
-declare module spine {
-	interface AttachmentLoader {
-		newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
-		newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
-		newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
-		newPathAttachment(skin: Skin, name: string): PathAttachment;
-	}
-}
-declare module spine {
-	enum AttachmentType {
-		Region = 0,
-		BoundingBox = 1,
-		Mesh = 2,
-		LinkedMesh = 3,
-		Path = 4,
-	}
-}
-declare module spine {
-	class BoundingBoxAttachment extends VertexAttachment {
-		color: Color;
-		constructor(name: string);
-	}
-}
-declare module spine {
-	class MeshAttachment extends VertexAttachment {
-		region: TextureRegion;
-		path: string;
-		regionUVs: ArrayLike<number>;
-		worldVertices: ArrayLike<number>;
-		triangles: Array<number>;
-		color: Color;
-		hullLength: number;
-		private parentMesh;
-		inheritDeform: boolean;
-		tempColor: Color;
-		constructor(name: string);
-		updateUVs(): void;
-		updateWorldVertices(slot: Slot, premultipliedAlpha: boolean): ArrayLike<number>;
-		applyDeform(sourceAttachment: VertexAttachment): boolean;
-		getParentMesh(): MeshAttachment;
-		setParentMesh(parentMesh: MeshAttachment): void;
-	}
-}
-declare module spine {
-	class PathAttachment extends VertexAttachment {
-		lengths: Array<number>;
-		closed: boolean;
-		constantSpeed: boolean;
-		color: Color;
-		constructor(name: string);
-	}
-}
-declare module spine {
-	class RegionAttachment extends Attachment {
-		static OX1: number;
-		static OY1: number;
-		static OX2: number;
-		static OY2: number;
-		static OX3: number;
-		static OY3: number;
-		static OX4: number;
-		static OY4: number;
-		static X1: number;
-		static Y1: number;
-		static C1R: number;
-		static C1G: number;
-		static C1B: number;
-		static C1A: number;
-		static U1: number;
-		static V1: number;
-		static X2: number;
-		static Y2: number;
-		static C2R: number;
-		static C2G: number;
-		static C2B: number;
-		static C2A: number;
-		static U2: number;
-		static V2: number;
-		static X3: number;
-		static Y3: number;
-		static C3R: number;
-		static C3G: number;
-		static C3B: number;
-		static C3A: number;
-		static U3: number;
-		static V3: number;
-		static X4: number;
-		static Y4: number;
-		static C4R: number;
-		static C4G: number;
-		static C4B: number;
-		static C4A: number;
-		static U4: number;
-		static V4: number;
-		x: number;
-		y: number;
-		scaleX: number;
-		scaleY: number;
-		rotation: number;
-		width: number;
-		height: number;
-		color: Color;
-		path: string;
-		rendererObject: any;
-		region: TextureRegion;
-		offset: ArrayLike<number>;
-		vertices: ArrayLike<number>;
-		tempColor: Color;
-		constructor(name: string);
-		setRegion(region: TextureRegion): void;
-		updateOffset(): void;
-		updateWorldVertices(slot: Slot, premultipliedAlpha: boolean): ArrayLike<number>;
+	interface ArrayLike<T> {
+		length: number;
+		[n: number]: T;
 	}
 	}
 }
 }

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 949 - 527
spine-ts/build/spine-core.js


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
spine-ts/build/spine-core.js.map


+ 133 - 129
spine-ts/build/spine-threejs.d.ts

@@ -256,6 +256,135 @@ declare module spine {
 		getErrors(): Map<string>;
 		getErrors(): Map<string>;
 	}
 	}
 }
 }
+declare module spine {
+	abstract class Attachment {
+		name: string;
+		constructor(name: string);
+	}
+	abstract class VertexAttachment extends Attachment {
+		bones: Array<number>;
+		vertices: ArrayLike<number>;
+		worldVerticesLength: number;
+		constructor(name: string);
+		computeWorldVertices(slot: Slot, worldVertices: ArrayLike<number>): void;
+		computeWorldVerticesWith(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number): void;
+		applyDeform(sourceAttachment: VertexAttachment): boolean;
+	}
+}
+declare module spine {
+	interface AttachmentLoader {
+		newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
+		newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
+		newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
+		newPathAttachment(skin: Skin, name: string): PathAttachment;
+	}
+}
+declare module spine {
+	enum AttachmentType {
+		Region = 0,
+		BoundingBox = 1,
+		Mesh = 2,
+		LinkedMesh = 3,
+		Path = 4,
+	}
+}
+declare module spine {
+	class BoundingBoxAttachment extends VertexAttachment {
+		color: Color;
+		constructor(name: string);
+	}
+}
+declare module spine {
+	class MeshAttachment extends VertexAttachment {
+		region: TextureRegion;
+		path: string;
+		regionUVs: ArrayLike<number>;
+		worldVertices: ArrayLike<number>;
+		triangles: Array<number>;
+		color: Color;
+		hullLength: number;
+		private parentMesh;
+		inheritDeform: boolean;
+		tempColor: Color;
+		constructor(name: string);
+		updateUVs(): void;
+		updateWorldVertices(slot: Slot, premultipliedAlpha: boolean): ArrayLike<number>;
+		applyDeform(sourceAttachment: VertexAttachment): boolean;
+		getParentMesh(): MeshAttachment;
+		setParentMesh(parentMesh: MeshAttachment): void;
+	}
+}
+declare module spine {
+	class PathAttachment extends VertexAttachment {
+		lengths: Array<number>;
+		closed: boolean;
+		constantSpeed: boolean;
+		color: Color;
+		constructor(name: string);
+	}
+}
+declare module spine {
+	class RegionAttachment extends Attachment {
+		static OX1: number;
+		static OY1: number;
+		static OX2: number;
+		static OY2: number;
+		static OX3: number;
+		static OY3: number;
+		static OX4: number;
+		static OY4: number;
+		static X1: number;
+		static Y1: number;
+		static C1R: number;
+		static C1G: number;
+		static C1B: number;
+		static C1A: number;
+		static U1: number;
+		static V1: number;
+		static X2: number;
+		static Y2: number;
+		static C2R: number;
+		static C2G: number;
+		static C2B: number;
+		static C2A: number;
+		static U2: number;
+		static V2: number;
+		static X3: number;
+		static Y3: number;
+		static C3R: number;
+		static C3G: number;
+		static C3B: number;
+		static C3A: number;
+		static U3: number;
+		static V3: number;
+		static X4: number;
+		static Y4: number;
+		static C4R: number;
+		static C4G: number;
+		static C4B: number;
+		static C4A: number;
+		static U4: number;
+		static V4: number;
+		x: number;
+		y: number;
+		scaleX: number;
+		scaleY: number;
+		rotation: number;
+		width: number;
+		height: number;
+		color: Color;
+		path: string;
+		rendererObject: any;
+		region: TextureRegion;
+		offset: ArrayLike<number>;
+		vertices: ArrayLike<number>;
+		tempColor: Color;
+		constructor(name: string);
+		setRegion(region: TextureRegion): void;
+		updateOffset(): void;
+		updateWorldVertices(slot: Slot, premultipliedAlpha: boolean): ArrayLike<number>;
+	}
+}
 declare module spine {
 declare module spine {
 	enum BlendMode {
 	enum BlendMode {
 		Normal = 0,
 		Normal = 0,
@@ -757,7 +886,7 @@ declare module spine {
 		static setArraySize<T>(array: Array<T>, size: number, value?: any): Array<T>;
 		static setArraySize<T>(array: Array<T>, size: number, value?: any): Array<T>;
 		static newArray<T>(size: number, defaultValue: T): Array<T>;
 		static newArray<T>(size: number, defaultValue: T): Array<T>;
 		static newFloatArray(size: number): ArrayLike<number>;
 		static newFloatArray(size: number): ArrayLike<number>;
-		static toFloatArray(array: Array<number>): Float32Array | number[];
+		static toFloatArray(array: Array<number>): number[] | Float32Array;
 	}
 	}
 	class DebugUtils {
 	class DebugUtils {
 		static logBones(skeleton: Skeleton): void;
 		static logBones(skeleton: Skeleton): void;
@@ -789,134 +918,9 @@ declare module spine {
 		private frameTime;
 		private frameTime;
 		update(): void;
 		update(): void;
 	}
 	}
-}
-declare module spine {
-	abstract class Attachment {
-		name: string;
-		constructor(name: string);
-	}
-	abstract class VertexAttachment extends Attachment {
-		bones: Array<number>;
-		vertices: ArrayLike<number>;
-		worldVerticesLength: number;
-		constructor(name: string);
-		computeWorldVertices(slot: Slot, worldVertices: ArrayLike<number>): void;
-		computeWorldVerticesWith(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number): void;
-		applyDeform(sourceAttachment: VertexAttachment): boolean;
-	}
-}
-declare module spine {
-	interface AttachmentLoader {
-		newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
-		newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
-		newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
-		newPathAttachment(skin: Skin, name: string): PathAttachment;
-	}
-}
-declare module spine {
-	enum AttachmentType {
-		Region = 0,
-		BoundingBox = 1,
-		Mesh = 2,
-		LinkedMesh = 3,
-		Path = 4,
-	}
-}
-declare module spine {
-	class BoundingBoxAttachment extends VertexAttachment {
-		color: Color;
-		constructor(name: string);
-	}
-}
-declare module spine {
-	class MeshAttachment extends VertexAttachment {
-		region: TextureRegion;
-		path: string;
-		regionUVs: ArrayLike<number>;
-		worldVertices: ArrayLike<number>;
-		triangles: Array<number>;
-		color: Color;
-		hullLength: number;
-		private parentMesh;
-		inheritDeform: boolean;
-		tempColor: Color;
-		constructor(name: string);
-		updateUVs(): void;
-		updateWorldVertices(slot: Slot, premultipliedAlpha: boolean): ArrayLike<number>;
-		applyDeform(sourceAttachment: VertexAttachment): boolean;
-		getParentMesh(): MeshAttachment;
-		setParentMesh(parentMesh: MeshAttachment): void;
-	}
-}
-declare module spine {
-	class PathAttachment extends VertexAttachment {
-		lengths: Array<number>;
-		closed: boolean;
-		constantSpeed: boolean;
-		color: Color;
-		constructor(name: string);
-	}
-}
-declare module spine {
-	class RegionAttachment extends Attachment {
-		static OX1: number;
-		static OY1: number;
-		static OX2: number;
-		static OY2: number;
-		static OX3: number;
-		static OY3: number;
-		static OX4: number;
-		static OY4: number;
-		static X1: number;
-		static Y1: number;
-		static C1R: number;
-		static C1G: number;
-		static C1B: number;
-		static C1A: number;
-		static U1: number;
-		static V1: number;
-		static X2: number;
-		static Y2: number;
-		static C2R: number;
-		static C2G: number;
-		static C2B: number;
-		static C2A: number;
-		static U2: number;
-		static V2: number;
-		static X3: number;
-		static Y3: number;
-		static C3R: number;
-		static C3G: number;
-		static C3B: number;
-		static C3A: number;
-		static U3: number;
-		static V3: number;
-		static X4: number;
-		static Y4: number;
-		static C4R: number;
-		static C4G: number;
-		static C4B: number;
-		static C4A: number;
-		static U4: number;
-		static V4: number;
-		x: number;
-		y: number;
-		scaleX: number;
-		scaleY: number;
-		rotation: number;
-		width: number;
-		height: number;
-		color: Color;
-		path: string;
-		rendererObject: any;
-		region: TextureRegion;
-		offset: ArrayLike<number>;
-		vertices: ArrayLike<number>;
-		tempColor: Color;
-		constructor(name: string);
-		setRegion(region: TextureRegion): void;
-		updateOffset(): void;
-		updateWorldVertices(slot: Slot, premultipliedAlpha: boolean): ArrayLike<number>;
+	interface ArrayLike<T> {
+		length: number;
+		[n: number]: T;
 	}
 	}
 }
 }
 declare module spine.threejs {
 declare module spine.threejs {

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 558 - 553
spine-ts/build/spine-threejs.js


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
spine-ts/build/spine-threejs.js.map


+ 133 - 129
spine-ts/build/spine-webgl.d.ts

@@ -256,6 +256,135 @@ declare module spine {
 		getErrors(): Map<string>;
 		getErrors(): Map<string>;
 	}
 	}
 }
 }
+declare module spine {
+	abstract class Attachment {
+		name: string;
+		constructor(name: string);
+	}
+	abstract class VertexAttachment extends Attachment {
+		bones: Array<number>;
+		vertices: ArrayLike<number>;
+		worldVerticesLength: number;
+		constructor(name: string);
+		computeWorldVertices(slot: Slot, worldVertices: ArrayLike<number>): void;
+		computeWorldVerticesWith(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number): void;
+		applyDeform(sourceAttachment: VertexAttachment): boolean;
+	}
+}
+declare module spine {
+	interface AttachmentLoader {
+		newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
+		newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
+		newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
+		newPathAttachment(skin: Skin, name: string): PathAttachment;
+	}
+}
+declare module spine {
+	enum AttachmentType {
+		Region = 0,
+		BoundingBox = 1,
+		Mesh = 2,
+		LinkedMesh = 3,
+		Path = 4,
+	}
+}
+declare module spine {
+	class BoundingBoxAttachment extends VertexAttachment {
+		color: Color;
+		constructor(name: string);
+	}
+}
+declare module spine {
+	class MeshAttachment extends VertexAttachment {
+		region: TextureRegion;
+		path: string;
+		regionUVs: ArrayLike<number>;
+		worldVertices: ArrayLike<number>;
+		triangles: Array<number>;
+		color: Color;
+		hullLength: number;
+		private parentMesh;
+		inheritDeform: boolean;
+		tempColor: Color;
+		constructor(name: string);
+		updateUVs(): void;
+		updateWorldVertices(slot: Slot, premultipliedAlpha: boolean): ArrayLike<number>;
+		applyDeform(sourceAttachment: VertexAttachment): boolean;
+		getParentMesh(): MeshAttachment;
+		setParentMesh(parentMesh: MeshAttachment): void;
+	}
+}
+declare module spine {
+	class PathAttachment extends VertexAttachment {
+		lengths: Array<number>;
+		closed: boolean;
+		constantSpeed: boolean;
+		color: Color;
+		constructor(name: string);
+	}
+}
+declare module spine {
+	class RegionAttachment extends Attachment {
+		static OX1: number;
+		static OY1: number;
+		static OX2: number;
+		static OY2: number;
+		static OX3: number;
+		static OY3: number;
+		static OX4: number;
+		static OY4: number;
+		static X1: number;
+		static Y1: number;
+		static C1R: number;
+		static C1G: number;
+		static C1B: number;
+		static C1A: number;
+		static U1: number;
+		static V1: number;
+		static X2: number;
+		static Y2: number;
+		static C2R: number;
+		static C2G: number;
+		static C2B: number;
+		static C2A: number;
+		static U2: number;
+		static V2: number;
+		static X3: number;
+		static Y3: number;
+		static C3R: number;
+		static C3G: number;
+		static C3B: number;
+		static C3A: number;
+		static U3: number;
+		static V3: number;
+		static X4: number;
+		static Y4: number;
+		static C4R: number;
+		static C4G: number;
+		static C4B: number;
+		static C4A: number;
+		static U4: number;
+		static V4: number;
+		x: number;
+		y: number;
+		scaleX: number;
+		scaleY: number;
+		rotation: number;
+		width: number;
+		height: number;
+		color: Color;
+		path: string;
+		rendererObject: any;
+		region: TextureRegion;
+		offset: ArrayLike<number>;
+		vertices: ArrayLike<number>;
+		tempColor: Color;
+		constructor(name: string);
+		setRegion(region: TextureRegion): void;
+		updateOffset(): void;
+		updateWorldVertices(slot: Slot, premultipliedAlpha: boolean): ArrayLike<number>;
+	}
+}
 declare module spine {
 declare module spine {
 	enum BlendMode {
 	enum BlendMode {
 		Normal = 0,
 		Normal = 0,
@@ -757,7 +886,7 @@ declare module spine {
 		static setArraySize<T>(array: Array<T>, size: number, value?: any): Array<T>;
 		static setArraySize<T>(array: Array<T>, size: number, value?: any): Array<T>;
 		static newArray<T>(size: number, defaultValue: T): Array<T>;
 		static newArray<T>(size: number, defaultValue: T): Array<T>;
 		static newFloatArray(size: number): ArrayLike<number>;
 		static newFloatArray(size: number): ArrayLike<number>;
-		static toFloatArray(array: Array<number>): Float32Array | number[];
+		static toFloatArray(array: Array<number>): number[] | Float32Array;
 	}
 	}
 	class DebugUtils {
 	class DebugUtils {
 		static logBones(skeleton: Skeleton): void;
 		static logBones(skeleton: Skeleton): void;
@@ -789,134 +918,9 @@ declare module spine {
 		private frameTime;
 		private frameTime;
 		update(): void;
 		update(): void;
 	}
 	}
-}
-declare module spine {
-	abstract class Attachment {
-		name: string;
-		constructor(name: string);
-	}
-	abstract class VertexAttachment extends Attachment {
-		bones: Array<number>;
-		vertices: ArrayLike<number>;
-		worldVerticesLength: number;
-		constructor(name: string);
-		computeWorldVertices(slot: Slot, worldVertices: ArrayLike<number>): void;
-		computeWorldVerticesWith(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number): void;
-		applyDeform(sourceAttachment: VertexAttachment): boolean;
-	}
-}
-declare module spine {
-	interface AttachmentLoader {
-		newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
-		newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
-		newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
-		newPathAttachment(skin: Skin, name: string): PathAttachment;
-	}
-}
-declare module spine {
-	enum AttachmentType {
-		Region = 0,
-		BoundingBox = 1,
-		Mesh = 2,
-		LinkedMesh = 3,
-		Path = 4,
-	}
-}
-declare module spine {
-	class BoundingBoxAttachment extends VertexAttachment {
-		color: Color;
-		constructor(name: string);
-	}
-}
-declare module spine {
-	class MeshAttachment extends VertexAttachment {
-		region: TextureRegion;
-		path: string;
-		regionUVs: ArrayLike<number>;
-		worldVertices: ArrayLike<number>;
-		triangles: Array<number>;
-		color: Color;
-		hullLength: number;
-		private parentMesh;
-		inheritDeform: boolean;
-		tempColor: Color;
-		constructor(name: string);
-		updateUVs(): void;
-		updateWorldVertices(slot: Slot, premultipliedAlpha: boolean): ArrayLike<number>;
-		applyDeform(sourceAttachment: VertexAttachment): boolean;
-		getParentMesh(): MeshAttachment;
-		setParentMesh(parentMesh: MeshAttachment): void;
-	}
-}
-declare module spine {
-	class PathAttachment extends VertexAttachment {
-		lengths: Array<number>;
-		closed: boolean;
-		constantSpeed: boolean;
-		color: Color;
-		constructor(name: string);
-	}
-}
-declare module spine {
-	class RegionAttachment extends Attachment {
-		static OX1: number;
-		static OY1: number;
-		static OX2: number;
-		static OY2: number;
-		static OX3: number;
-		static OY3: number;
-		static OX4: number;
-		static OY4: number;
-		static X1: number;
-		static Y1: number;
-		static C1R: number;
-		static C1G: number;
-		static C1B: number;
-		static C1A: number;
-		static U1: number;
-		static V1: number;
-		static X2: number;
-		static Y2: number;
-		static C2R: number;
-		static C2G: number;
-		static C2B: number;
-		static C2A: number;
-		static U2: number;
-		static V2: number;
-		static X3: number;
-		static Y3: number;
-		static C3R: number;
-		static C3G: number;
-		static C3B: number;
-		static C3A: number;
-		static U3: number;
-		static V3: number;
-		static X4: number;
-		static Y4: number;
-		static C4R: number;
-		static C4G: number;
-		static C4B: number;
-		static C4A: number;
-		static U4: number;
-		static V4: number;
-		x: number;
-		y: number;
-		scaleX: number;
-		scaleY: number;
-		rotation: number;
-		width: number;
-		height: number;
-		color: Color;
-		path: string;
-		rendererObject: any;
-		region: TextureRegion;
-		offset: ArrayLike<number>;
-		vertices: ArrayLike<number>;
-		tempColor: Color;
-		constructor(name: string);
-		setRegion(region: TextureRegion): void;
-		updateOffset(): void;
-		updateWorldVertices(slot: Slot, premultipliedAlpha: boolean): ArrayLike<number>;
+	interface ArrayLike<T> {
+		length: number;
+		[n: number]: T;
 	}
 	}
 }
 }
 declare module spine.webgl {
 declare module spine.webgl {

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 949 - 527
spine-ts/build/spine-webgl.js


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
spine-ts/build/spine-webgl.js.map


+ 133 - 129
spine-ts/build/spine-widget.d.ts

@@ -256,6 +256,135 @@ declare module spine {
 		getErrors(): Map<string>;
 		getErrors(): Map<string>;
 	}
 	}
 }
 }
+declare module spine {
+	abstract class Attachment {
+		name: string;
+		constructor(name: string);
+	}
+	abstract class VertexAttachment extends Attachment {
+		bones: Array<number>;
+		vertices: ArrayLike<number>;
+		worldVerticesLength: number;
+		constructor(name: string);
+		computeWorldVertices(slot: Slot, worldVertices: ArrayLike<number>): void;
+		computeWorldVerticesWith(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number): void;
+		applyDeform(sourceAttachment: VertexAttachment): boolean;
+	}
+}
+declare module spine {
+	interface AttachmentLoader {
+		newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
+		newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
+		newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
+		newPathAttachment(skin: Skin, name: string): PathAttachment;
+	}
+}
+declare module spine {
+	enum AttachmentType {
+		Region = 0,
+		BoundingBox = 1,
+		Mesh = 2,
+		LinkedMesh = 3,
+		Path = 4,
+	}
+}
+declare module spine {
+	class BoundingBoxAttachment extends VertexAttachment {
+		color: Color;
+		constructor(name: string);
+	}
+}
+declare module spine {
+	class MeshAttachment extends VertexAttachment {
+		region: TextureRegion;
+		path: string;
+		regionUVs: ArrayLike<number>;
+		worldVertices: ArrayLike<number>;
+		triangles: Array<number>;
+		color: Color;
+		hullLength: number;
+		private parentMesh;
+		inheritDeform: boolean;
+		tempColor: Color;
+		constructor(name: string);
+		updateUVs(): void;
+		updateWorldVertices(slot: Slot, premultipliedAlpha: boolean): ArrayLike<number>;
+		applyDeform(sourceAttachment: VertexAttachment): boolean;
+		getParentMesh(): MeshAttachment;
+		setParentMesh(parentMesh: MeshAttachment): void;
+	}
+}
+declare module spine {
+	class PathAttachment extends VertexAttachment {
+		lengths: Array<number>;
+		closed: boolean;
+		constantSpeed: boolean;
+		color: Color;
+		constructor(name: string);
+	}
+}
+declare module spine {
+	class RegionAttachment extends Attachment {
+		static OX1: number;
+		static OY1: number;
+		static OX2: number;
+		static OY2: number;
+		static OX3: number;
+		static OY3: number;
+		static OX4: number;
+		static OY4: number;
+		static X1: number;
+		static Y1: number;
+		static C1R: number;
+		static C1G: number;
+		static C1B: number;
+		static C1A: number;
+		static U1: number;
+		static V1: number;
+		static X2: number;
+		static Y2: number;
+		static C2R: number;
+		static C2G: number;
+		static C2B: number;
+		static C2A: number;
+		static U2: number;
+		static V2: number;
+		static X3: number;
+		static Y3: number;
+		static C3R: number;
+		static C3G: number;
+		static C3B: number;
+		static C3A: number;
+		static U3: number;
+		static V3: number;
+		static X4: number;
+		static Y4: number;
+		static C4R: number;
+		static C4G: number;
+		static C4B: number;
+		static C4A: number;
+		static U4: number;
+		static V4: number;
+		x: number;
+		y: number;
+		scaleX: number;
+		scaleY: number;
+		rotation: number;
+		width: number;
+		height: number;
+		color: Color;
+		path: string;
+		rendererObject: any;
+		region: TextureRegion;
+		offset: ArrayLike<number>;
+		vertices: ArrayLike<number>;
+		tempColor: Color;
+		constructor(name: string);
+		setRegion(region: TextureRegion): void;
+		updateOffset(): void;
+		updateWorldVertices(slot: Slot, premultipliedAlpha: boolean): ArrayLike<number>;
+	}
+}
 declare module spine {
 declare module spine {
 	enum BlendMode {
 	enum BlendMode {
 		Normal = 0,
 		Normal = 0,
@@ -757,7 +886,7 @@ declare module spine {
 		static setArraySize<T>(array: Array<T>, size: number, value?: any): Array<T>;
 		static setArraySize<T>(array: Array<T>, size: number, value?: any): Array<T>;
 		static newArray<T>(size: number, defaultValue: T): Array<T>;
 		static newArray<T>(size: number, defaultValue: T): Array<T>;
 		static newFloatArray(size: number): ArrayLike<number>;
 		static newFloatArray(size: number): ArrayLike<number>;
-		static toFloatArray(array: Array<number>): Float32Array | number[];
+		static toFloatArray(array: Array<number>): number[] | Float32Array;
 	}
 	}
 	class DebugUtils {
 	class DebugUtils {
 		static logBones(skeleton: Skeleton): void;
 		static logBones(skeleton: Skeleton): void;
@@ -789,134 +918,9 @@ declare module spine {
 		private frameTime;
 		private frameTime;
 		update(): void;
 		update(): void;
 	}
 	}
-}
-declare module spine {
-	abstract class Attachment {
-		name: string;
-		constructor(name: string);
-	}
-	abstract class VertexAttachment extends Attachment {
-		bones: Array<number>;
-		vertices: ArrayLike<number>;
-		worldVerticesLength: number;
-		constructor(name: string);
-		computeWorldVertices(slot: Slot, worldVertices: ArrayLike<number>): void;
-		computeWorldVerticesWith(slot: Slot, start: number, count: number, worldVertices: ArrayLike<number>, offset: number): void;
-		applyDeform(sourceAttachment: VertexAttachment): boolean;
-	}
-}
-declare module spine {
-	interface AttachmentLoader {
-		newRegionAttachment(skin: Skin, name: string, path: string): RegionAttachment;
-		newMeshAttachment(skin: Skin, name: string, path: string): MeshAttachment;
-		newBoundingBoxAttachment(skin: Skin, name: string): BoundingBoxAttachment;
-		newPathAttachment(skin: Skin, name: string): PathAttachment;
-	}
-}
-declare module spine {
-	enum AttachmentType {
-		Region = 0,
-		BoundingBox = 1,
-		Mesh = 2,
-		LinkedMesh = 3,
-		Path = 4,
-	}
-}
-declare module spine {
-	class BoundingBoxAttachment extends VertexAttachment {
-		color: Color;
-		constructor(name: string);
-	}
-}
-declare module spine {
-	class MeshAttachment extends VertexAttachment {
-		region: TextureRegion;
-		path: string;
-		regionUVs: ArrayLike<number>;
-		worldVertices: ArrayLike<number>;
-		triangles: Array<number>;
-		color: Color;
-		hullLength: number;
-		private parentMesh;
-		inheritDeform: boolean;
-		tempColor: Color;
-		constructor(name: string);
-		updateUVs(): void;
-		updateWorldVertices(slot: Slot, premultipliedAlpha: boolean): ArrayLike<number>;
-		applyDeform(sourceAttachment: VertexAttachment): boolean;
-		getParentMesh(): MeshAttachment;
-		setParentMesh(parentMesh: MeshAttachment): void;
-	}
-}
-declare module spine {
-	class PathAttachment extends VertexAttachment {
-		lengths: Array<number>;
-		closed: boolean;
-		constantSpeed: boolean;
-		color: Color;
-		constructor(name: string);
-	}
-}
-declare module spine {
-	class RegionAttachment extends Attachment {
-		static OX1: number;
-		static OY1: number;
-		static OX2: number;
-		static OY2: number;
-		static OX3: number;
-		static OY3: number;
-		static OX4: number;
-		static OY4: number;
-		static X1: number;
-		static Y1: number;
-		static C1R: number;
-		static C1G: number;
-		static C1B: number;
-		static C1A: number;
-		static U1: number;
-		static V1: number;
-		static X2: number;
-		static Y2: number;
-		static C2R: number;
-		static C2G: number;
-		static C2B: number;
-		static C2A: number;
-		static U2: number;
-		static V2: number;
-		static X3: number;
-		static Y3: number;
-		static C3R: number;
-		static C3G: number;
-		static C3B: number;
-		static C3A: number;
-		static U3: number;
-		static V3: number;
-		static X4: number;
-		static Y4: number;
-		static C4R: number;
-		static C4G: number;
-		static C4B: number;
-		static C4A: number;
-		static U4: number;
-		static V4: number;
-		x: number;
-		y: number;
-		scaleX: number;
-		scaleY: number;
-		rotation: number;
-		width: number;
-		height: number;
-		color: Color;
-		path: string;
-		rendererObject: any;
-		region: TextureRegion;
-		offset: ArrayLike<number>;
-		vertices: ArrayLike<number>;
-		tempColor: Color;
-		constructor(name: string);
-		setRegion(region: TextureRegion): void;
-		updateOffset(): void;
-		updateWorldVertices(slot: Slot, premultipliedAlpha: boolean): ArrayLike<number>;
+	interface ArrayLike<T> {
+		length: number;
+		[n: number]: T;
 	}
 	}
 }
 }
 declare module spine.webgl {
 declare module spine.webgl {

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 949 - 527
spine-ts/build/spine-widget.js


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
spine-ts/build/spine-widget.js.map


+ 11 - 11
spine-ts/core/src/AnimationState.ts

@@ -108,17 +108,17 @@ module spine {
 
 
 				for (let ii = 0, nn = events.length; ii < nn; ii++) {
 				for (let ii = 0, nn = events.length; ii < nn; ii++) {
 					let event = events[ii];
 					let event = events[ii];
-					if (current.listener != null) current.listener.event(i, event);
+					if (current.listener != null && current.listener.event != null) current.listener.event(i, event);
 					for (let iii = 0; iii < listenerCount; iii++)
 					for (let iii = 0; iii < listenerCount; iii++)
-						this.listeners[iii].event(i, event);
+						if (this.listeners[iii].event) this.listeners[iii].event(i, event);
 				}
 				}
 
 
 				// Check if completed the animation or a loop iteration.
 				// Check if completed the animation or a loop iteration.
 				if (loop ? (lastTime % endTime > time % endTime) : (lastTime < endTime && time >= endTime)) {
 				if (loop ? (lastTime % endTime > time % endTime) : (lastTime < endTime && time >= endTime)) {
 					let count = MathUtils.toInt(time / endTime);
 					let count = MathUtils.toInt(time / endTime);
-					if (current.listener != null) current.listener.complete(i, count);
+					if (current.listener != null && current.listener.complete) current.listener.complete(i, count);
 					for (let ii = 0, nn = this.listeners.length; ii < nn; ii++)
 					for (let ii = 0, nn = this.listeners.length; ii < nn; ii++)
-						this.listeners[ii].complete(i, count);
+						if (this.listeners[ii].complete) this.listeners[ii].complete(i, count);
 				}
 				}
 
 
 				current.lastTime = current.time;
 				current.lastTime = current.time;
@@ -136,9 +136,9 @@ module spine {
 			let current = this.tracks[trackIndex];
 			let current = this.tracks[trackIndex];
 			if (current == null) return;
 			if (current == null) return;
 
 
-			if (current.listener != null) current.listener.end(trackIndex);
-			for (let i = 0, n = this.listeners.length; i < n; i++)
-				this.listeners[i].end(trackIndex);
+			if (current.listener != null && current.listener.end != null) current.listener.end(trackIndex);
+			for (let i = 0, n = this.listeners.length; i < n; i++)			
+				if (this.listeners[i].end) this.listeners[i].end(trackIndex);
 
 
 			this.tracks[trackIndex] = null;
 			this.tracks[trackIndex] = null;
 
 
@@ -165,9 +165,9 @@ module spine {
 				let previous = current.previous;
 				let previous = current.previous;
 				current.previous = null;
 				current.previous = null;
 
 
-				if (current.listener != null) current.listener.end(index);
+				if (current.listener != null && current.listener.end != null) current.listener.end(index);
 				for (let i = 0, n = this.listeners.length; i < n; i++)
 				for (let i = 0, n = this.listeners.length; i < n; i++)
-					this.listeners[i].end(index);
+					if (this.listeners[i].end) this.listeners[i].end(index);
 
 
 				entry.mixDuration = this.data.getMix(current.animation, entry.animation);
 				entry.mixDuration = this.data.getMix(current.animation, entry.animation);
 				if (entry.mixDuration > 0) {
 				if (entry.mixDuration > 0) {
@@ -183,9 +183,9 @@ module spine {
 
 
 			this.tracks[index] = entry;
 			this.tracks[index] = entry;
 
 
-			if (entry.listener != null) entry.listener.start(index);
+			if (entry.listener != null && entry.listener.start != null) entry.listener.start(index);
 			for (let i = 0, n = this.listeners.length; i < n; i++)
 			for (let i = 0, n = this.listeners.length; i < n; i++)
-				this.listeners[i].start(index);
+				if (this.listeners[i].start) this.listeners[i].start(index);
 		}
 		}
 
 
 		/** @see #setAnimation(int, Animation, boolean) */
 		/** @see #setAnimation(int, Animation, boolean) */

+ 1 - 1
spine-ts/core/src/Skin.ts

@@ -64,7 +64,7 @@ module spine {
 					for (let key in dictionary) {
 					for (let key in dictionary) {
 						let skinAttachment:Attachment = dictionary[key];
 						let skinAttachment:Attachment = dictionary[key];
 						if (slotAttachment == skinAttachment) {
 						if (slotAttachment == skinAttachment) {
-							let attachment = this.getAttachment(slotIndex, name);
+							let attachment = this.getAttachment(slotIndex, key);
 							if (attachment != null) slot.setAttachment(attachment);
 							if (attachment != null) slot.setAttachment(attachment);
 							break;
 							break;
 						}
 						}

+ 1 - 2
spine-ts/core/src/TextureAtlasAttachmentLoader.ts

@@ -43,8 +43,7 @@ module spine {
 			if (region == null) throw new Error("Region not found in atlas: " + path + " (region attachment: " + name + ")");
 			if (region == null) throw new Error("Region not found in atlas: " + path + " (region attachment: " + name + ")");
 			region.renderObject = region;
 			region.renderObject = region;
 			let attachment = new RegionAttachment(name);
 			let attachment = new RegionAttachment(name);
-			attachment.setRegion(region);
-			attachment.region = region;
+			attachment.setRegion(region);			
 			return attachment;
 			return attachment;
 		}
 		}
 
 

+ 5 - 0
spine-ts/core/src/Utils.ts

@@ -261,4 +261,9 @@ module spine {
 			}
 			}
 		}
 		}
 	}
 	}
+
+	export interface ArrayLike<T> {
+		length: number;
+		[n: number]: T;
+	}
 }
 }

+ 1 - 0
spine-ts/core/src/attachments/RegionAttachment.ts

@@ -113,6 +113,7 @@ module spine {
 				vertices[RegionAttachment.U4] = region.u2;
 				vertices[RegionAttachment.U4] = region.u2;
 				vertices[RegionAttachment.V4] = region.v2;
 				vertices[RegionAttachment.V4] = region.v2;
 			}
 			}
+			this.region = region;
 		}
 		}
 
 
 		updateOffset () : void {
 		updateOffset () : void {

+ 1 - 2
spine-ts/threejs/src/ThreeJsTexture.ts

@@ -56,8 +56,7 @@ module spine.threejs {
 
 
 		static toThreeJsTextureFilter(filter: TextureFilter) {
 		static toThreeJsTextureFilter(filter: TextureFilter) {
 			if (filter === TextureFilter.Linear) return THREE.LinearFilter;
 			if (filter === TextureFilter.Linear) return THREE.LinearFilter;
-			else if (filter === TextureFilter.MipMap) return THREE.LinearMipMapLinearFilter;
-			else if (filter === TextureFilter.MipMapLinearLinear) return THREE.LinearMipMapLinearFilter;
+			else if (filter === TextureFilter.MipMap) return THREE.LinearMipMapLinearFilter; // also includes TextureFilter.MipMapLinearLinear			
 			else if (filter === TextureFilter.MipMapLinearNearest) return THREE.LinearMipMapNearestFilter;
 			else if (filter === TextureFilter.MipMapLinearNearest) return THREE.LinearMipMapNearestFilter;
 			else if (filter === TextureFilter.MipMapNearestLinear) return THREE.NearestMipMapLinearFilter;
 			else if (filter === TextureFilter.MipMapNearestLinear) return THREE.NearestMipMapLinearFilter;
 			else if (filter === TextureFilter.MipMapNearestNearest) return THREE.NearestMipMapNearestFilter;
 			else if (filter === TextureFilter.MipMapNearestNearest) return THREE.NearestMipMapNearestFilter;

+ 1 - 1
spine-ts/webgl/example/index.html

@@ -84,7 +84,7 @@ function load () {
 		skeletons["spineboy"] = loadSkeleton("spineboy", "run", false);
 		skeletons["spineboy"] = loadSkeleton("spineboy", "run", false);
 		skeletons["raptor"] = loadSkeleton("raptor", "walk", false);
 		skeletons["raptor"] = loadSkeleton("raptor", "walk", false);
 		skeletons["tank"] = loadSkeleton("tank", "drive", false);
 		skeletons["tank"] = loadSkeleton("tank", "drive", false);
-		skeletons["goblins"] = loadSkeleton("goblins-mesh", "walk", true, "goblin");
+		skeletons["goblins"] = loadSkeleton("goblins-mesh", "walk", false, "goblin");
 		skeletons["vine"] = loadSkeleton("vine", "animation", false);
 		skeletons["vine"] = loadSkeleton("vine", "animation", false);
 		skeletons["stretchyman"] = loadSkeleton("stretchyman", "sneak", false);				
 		skeletons["stretchyman"] = loadSkeleton("stretchyman", "sneak", false);				
 		setupUI();
 		setupUI();

+ 59 - 19
spine-unity/Assets/spine-unity/Asset Types/Editor/AtlasAssetInspector.cs

@@ -46,6 +46,11 @@ namespace Spine.Unity.Editor {
 		private SerializedProperty atlasFile, materials;
 		private SerializedProperty atlasFile, materials;
 		private AtlasAsset atlasAsset;
 		private AtlasAsset atlasAsset;
 
 
+		static List<AtlasRegion> GetRegions (Atlas atlas) {
+			FieldInfo regionsField = typeof(Atlas).GetField("regions", BindingFlags.Instance | BindingFlags.NonPublic);
+			return (List<AtlasRegion>)regionsField.GetValue(atlas);
+		}
+
 		void OnEnable () {
 		void OnEnable () {
 			SpineEditorUtilities.ConfirmInitialization();
 			SpineEditorUtilities.ConfirmInitialization();
 			atlasFile = serializedObject.FindProperty("atlasFile");
 			atlasFile = serializedObject.FindProperty("atlasFile");
@@ -56,7 +61,7 @@ namespace Spine.Unity.Editor {
 			UpdateBakedList();
 			UpdateBakedList();
 			#endif
 			#endif
 		}
 		}
-			
+
 		#if REGION_BAKING_MESH
 		#if REGION_BAKING_MESH
 		private List<bool> baked;
 		private List<bool> baked;
 		private List<GameObject> bakedObjects;
 		private List<GameObject> bakedObjects;
@@ -66,14 +71,10 @@ namespace Spine.Unity.Editor {
 			baked = new List<bool>();
 			baked = new List<bool>();
 			bakedObjects = new List<GameObject>();
 			bakedObjects = new List<GameObject>();
 			if (atlasFile.objectReferenceValue != null) {
 			if (atlasFile.objectReferenceValue != null) {
-				Atlas atlas = asset.GetAtlas();
-				FieldInfo field = typeof(Atlas).GetField("regions", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.NonPublic);
-				List<AtlasRegion> regions = (List<AtlasRegion>)field.GetValue(atlas);
+				List<AtlasRegion> regions = this.Regions;
 				string atlasAssetPath = AssetDatabase.GetAssetPath(atlasAsset);
 				string atlasAssetPath = AssetDatabase.GetAssetPath(atlasAsset);
 				string atlasAssetDirPath = Path.GetDirectoryName(atlasAssetPath);
 				string atlasAssetDirPath = Path.GetDirectoryName(atlasAssetPath);
 				string bakedDirPath = Path.Combine(atlasAssetDirPath, atlasAsset.name);
 				string bakedDirPath = Path.Combine(atlasAssetDirPath, atlasAsset.name);
-
-
 				for (int i = 0; i < regions.Count; i++) {
 				for (int i = 0; i < regions.Count; i++) {
 					AtlasRegion region = regions[i];
 					AtlasRegion region = regions[i];
 					string bakedPrefabPath = Path.Combine(bakedDirPath, SpineEditorUtilities.GetPathSafeRegionName(region) + ".prefab").Replace("\\", "/");
 					string bakedPrefabPath = Path.Combine(bakedDirPath, SpineEditorUtilities.GetPathSafeRegionName(region) + ".prefab").Replace("\\", "/");
@@ -92,8 +93,7 @@ namespace Spine.Unity.Editor {
 			var spriteSheet = t.spritesheet;
 			var spriteSheet = t.spritesheet;
 			var sprites = new List<SpriteMetaData>(spriteSheet);
 			var sprites = new List<SpriteMetaData>(spriteSheet);
 
 
-			FieldInfo field = typeof(Atlas).GetField("regions", BindingFlags.Instance | BindingFlags.NonPublic);
-			var regions = (List<AtlasRegion>)field.GetValue(atlas);
+			var regions = AtlasAssetInspector.GetRegions(atlas);
 			int textureHeight = texture.height;
 			int textureHeight = texture.height;
 			char[] FilenameDelimiter = {'.'};
 			char[] FilenameDelimiter = {'.'};
 			int updatedCount = 0;
 			int updatedCount = 0;
@@ -168,20 +168,27 @@ namespace Spine.Unity.Editor {
 				}
 				}
 			}
 			}
 
 
+			EditorGUILayout.Space();
 			if (atlasFile.objectReferenceValue != null) {
 			if (atlasFile.objectReferenceValue != null) {
-				if (GUILayout.Button(
-					new GUIContent(
-						"Apply Regions as Texture Sprite Slices",
-						"Adds Sprite slices to atlas texture(s). " +
-						"Updates existing slices if ones with matching names exist. \n\n" +
-						"If your atlas was exported with Premultiply Alpha, " +
-						"your SpriteRenderer should use the generated Spine _Material asset (or any Material with a PMA shader) instead of Sprites-Default.")
-					, GUILayout.Height(70f))) {
-					var atlas = atlasAsset.GetAtlas();
-					foreach (var m in atlasAsset.materials)
-						UpdateSpriteSlices(m.mainTexture, atlas);
+				using (new EditorGUILayout.HorizontalScope()) {
+					EditorGUILayout.Space();
+					if (GUILayout.Button(
+						new GUIContent(
+							"Apply Regions as Texture Sprite Slices",
+							SpineEditorUtilities.Icons.unityIcon,
+							"Adds Sprite slices to atlas texture(s). " +
+							"Updates existing slices if ones with matching names exist. \n\n" +
+							"If your atlas was exported with Premultiply Alpha, " +
+							"your SpriteRenderer should use the generated Spine _Material asset (or any Material with a PMA shader) instead of Sprites-Default.")
+						, GUILayout.Height(30f))) {
+						var atlas = atlasAsset.GetAtlas();
+						foreach (var m in atlasAsset.materials)
+							UpdateSpriteSlices(m.mainTexture, atlas);
+					}
+					EditorGUILayout.Space();
 				}
 				}
 			}
 			}
+			EditorGUILayout.Space();
 
 
 			#if REGION_BAKING_MESH
 			#if REGION_BAKING_MESH
 			if (atlasFile.objectReferenceValue != null) {
 			if (atlasFile.objectReferenceValue != null) {
@@ -289,6 +296,39 @@ namespace Spine.Unity.Editor {
 				#endif
 				#endif
 				
 				
 			}
 			}
+			#else
+			if (atlasFile.objectReferenceValue != null) {
+				EditorGUILayout.LabelField("Atlas Regions", EditorStyles.boldLabel);
+
+				var regions = AtlasAssetInspector.GetRegions(atlasAsset.GetAtlas());
+				AtlasPage lastPage = null;
+				for (int i = 0; i < regions.Count; i++) {
+					if (lastPage != regions[i].page) {
+						if (lastPage != null) {
+							EditorGUILayout.Separator();
+							EditorGUILayout.Separator();
+						}
+						lastPage = regions[i].page;
+						Material mat = ((Material)lastPage.rendererObject);
+						if (mat != null) {
+							
+							GUILayout.BeginHorizontal();
+							{
+								EditorGUI.BeginDisabledGroup(true);
+								EditorGUILayout.ObjectField(mat, typeof(Material), false, GUILayout.Width(250));
+								EditorGUI.EndDisabledGroup();
+								EditorGUI.indentLevel++;
+							}
+							GUILayout.EndHorizontal();
+
+						} else {
+							EditorGUILayout.LabelField(new GUIContent("Page missing material!", SpineEditorUtilities.Icons.warning));
+						}
+					}
+					EditorGUILayout.LabelField(new GUIContent(regions[i].name, SpineEditorUtilities.Icons.image));
+				}
+				EditorGUI.indentLevel--;
+			}
 			#endif
 			#endif
 
 
 			if (serializedObject.ApplyModifiedProperties() ||
 			if (serializedObject.ApplyModifiedProperties() ||

+ 61 - 0
spine-unity/Assets/spine-unity/Editor/SpineEditorUtilities.cs

@@ -1434,6 +1434,67 @@ namespace Spine.Unity.Editor {
 		}
 		}
 		#endregion
 		#endregion
 
 
+		#region Handles
+		static public void DrawBone (Matrix4x4 transformMatrix) {
+			SpineEditorUtilities.Icons.BoneMaterial.SetPass(0);
+			Graphics.DrawMeshNow(SpineEditorUtilities.Icons.BoneMesh, transformMatrix);
+		}
+
+		static float[] pathVertexBuffer;
+		static public void DrawPath (Slot s, PathAttachment p, Transform t) {
+			int worldVerticesLength = p.WorldVerticesLength;
+
+			if (pathVertexBuffer == null || pathVertexBuffer.Length < worldVerticesLength)
+				pathVertexBuffer = new float[worldVerticesLength];
+			
+			float[] pv = pathVertexBuffer;
+			p.ComputeWorldVertices(s, pv);
+
+			var ocolor = Handles.color;
+			Handles.color = new Color(254f/255f, 127f/255f, 0); // Path orange
+
+			Matrix4x4 m = t.localToWorldMatrix;
+			const int step = 6;
+			int n = worldVerticesLength - step;
+			Vector3 p0, p1, p2, p3;
+			for (int i = 2; i < n; i += step) {
+				p0 = m.MultiplyPoint(new Vector3(pv[i], pv[i+1]));
+				p1 = m.MultiplyPoint(new Vector3(pv[i+2], pv[i+3]));
+				p2 = m.MultiplyPoint(new Vector3(pv[i+4], pv[i+5]));
+				p3 = m.MultiplyPoint(new Vector3(pv[i+6], pv[i+7]));
+				DrawCubicBezier(p0, p1, p2, p3);
+			}
+
+			n += step;
+			if (p.Closed) {
+				p0 = m.MultiplyPoint(new Vector3(pv[n - 4], pv[n - 3]));
+				p1 = m.MultiplyPoint(new Vector3(pv[n - 2], pv[n - 1]));
+				p2 = m.MultiplyPoint(new Vector3(pv[0], pv[1]));
+				p3 = m.MultiplyPoint(new Vector3(pv[2], pv[3]));
+				DrawCubicBezier(p0, p1, p2, p3);
+			}
+
+			const float endCapSize = 0.05f;
+			var q = Quaternion.identity;
+			Handles.DotCap(0, m.MultiplyPoint(new Vector3(pv[2], pv[3])), q, endCapSize);
+//			if (!p.Closed) Handles.DotCap(0, m.MultiplyPoint(new Vector3(pv[n - 4], pv[n - 3])), q, endCapSize);
+
+			Handles.color = ocolor;
+		}
+
+		static public void DrawCubicBezier (Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3) {
+			Handles.DrawBezier(p0, p3, p1, p2, Handles.color, Texture2D.whiteTexture, 2f);
+//			const float dotSize = 0.01f;
+//			Quaternion q = Quaternion.identity;
+//			Handles.DotCap(0, p0, q, dotSize);
+//			Handles.DotCap(0, p1, q, dotSize);
+//			Handles.DotCap(0, p2, q, dotSize);
+//			Handles.DotCap(0, p3, q, dotSize);
+//			Handles.DrawLine(p0, p1);
+//			Handles.DrawLine(p3, p2);
+		}
+		#endregion
+
 		public static string GetPathSafeRegionName (AtlasRegion region) {
 		public static string GetPathSafeRegionName (AtlasRegion region) {
 			return region.name.Replace("/", "_");
 			return region.name.Replace("/", "_");
 		}
 		}

+ 2 - 2
spine-unity/Assets/spine-unity/Editor/SpineInspectorUtility.cs

@@ -1,4 +1,4 @@
-/******************************************************************************
+/******************************************************************************
  * Spine Runtimes Software License
  * Spine Runtimes Software License
  * Version 2.3
  * Version 2.3
  * 
  * 
@@ -46,7 +46,7 @@ namespace Spine.Unity.Editor {
 
 
 		public static void PropertyFieldWideLabel (SerializedProperty property, GUIContent label = null, float minimumLabelWidth = 150) {
 		public static void PropertyFieldWideLabel (SerializedProperty property, GUIContent label = null, float minimumLabelWidth = 150) {
 			using (new EditorGUILayout.HorizontalScope()) {
 			using (new EditorGUILayout.HorizontalScope()) {
-				GUILayout.Label(label ?? new GUIContent(property.name, property.tooltip), GUILayout.MinWidth(minimumLabelWidth));
+				GUILayout.Label(label ?? new GUIContent(property.displayName, property.tooltip), GUILayout.MinWidth(minimumLabelWidth));
 				//GUILayout.FlexibleSpace();
 				//GUILayout.FlexibleSpace();
 				EditorGUILayout.PropertyField(property, GUIContent.none, true, GUILayout.MinWidth(100));
 				EditorGUILayout.PropertyField(property, GUIContent.none, true, GUILayout.MinWidth(100));
 			}
 			}

+ 18 - 8
spine-unity/Assets/spine-unity/Mesh Generation/Arrays/ArraysMeshGenerator.cs

@@ -1,4 +1,4 @@
-/******************************************************************************
+/******************************************************************************
  * Spine Runtimes Software License
  * Spine Runtimes Software License
  * Version 2.3
  * Version 2.3
  * 
  * 
@@ -162,9 +162,8 @@ namespace Spine.Unity.MeshGeneration {
 					uvs[vi + 2].x = regionUVs[RegionAttachment.X2]; uvs[vi + 2].y = regionUVs[RegionAttachment.Y2];
 					uvs[vi + 2].x = regionUVs[RegionAttachment.X2]; uvs[vi + 2].y = regionUVs[RegionAttachment.Y2];
 					uvs[vi + 3].x = regionUVs[RegionAttachment.X3]; uvs[vi + 3].y = regionUVs[RegionAttachment.Y3];
 					uvs[vi + 3].x = regionUVs[RegionAttachment.X3]; uvs[vi + 3].y = regionUVs[RegionAttachment.Y3];
 
 
-					// Calculate min/max X
-					if (x1 < bmin.x) bmin.x = x1;
-					else if (x1 > bmax.x) bmax.x = x1;
+					if (x1 < bmin.x) bmin.x = x1; // Potential first attachment bounds initialization. Initial min should not block initial max. Same for Y below.
+					if (x1 > bmax.x) bmax.x = x1;
 					if (x2 < bmin.x) bmin.x = x2;
 					if (x2 < bmin.x) bmin.x = x2;
 					else if (x2 > bmax.x) bmax.x = x2;
 					else if (x2 > bmax.x) bmax.x = x2;
 					if (x3 < bmin.x) bmin.x = x3;
 					if (x3 < bmin.x) bmin.x = x3;
@@ -172,9 +171,8 @@ namespace Spine.Unity.MeshGeneration {
 					if (x4 < bmin.x) bmin.x = x4;
 					if (x4 < bmin.x) bmin.x = x4;
 					else if (x4 > bmax.x) bmax.x = x4;
 					else if (x4 > bmax.x) bmax.x = x4;
 
 
-					// Calculate min/max Y
 					if (y1 < bmin.y) bmin.y = y1;
 					if (y1 < bmin.y) bmin.y = y1;
-					else if (y1 > bmax.y) bmax.y = y1;
+					if (y1 > bmax.y) bmax.y = y1;
 					if (y2 < bmin.y) bmin.y = y2;
 					if (y2 < bmin.y) bmin.y = y2;
 					else if (y2 > bmax.y) bmax.y = y2;
 					else if (y2 > bmax.y) bmax.y = y2;
 					if (y3 < bmin.y) bmin.y = y3;
 					if (y3 < bmin.y) bmin.y = y3;
@@ -204,6 +202,19 @@ namespace Spine.Unity.MeshGeneration {
 						}
 						}
 
 
 						float[] attachmentUVs = meshAttachment.uvs;
 						float[] attachmentUVs = meshAttachment.uvs;
+
+						// Potential first attachment bounds initialization. See conditions in RegionAttachment logic.
+						if (vi == vertexIndex) {
+							// Initial min should not block initial max.
+							// vi == vertexIndex does not always mean the bounds are fresh. It could be a submesh. Do not nuke old values by omitting the check.
+							// Should know that this is the first attachment in the submesh. slotIndex == startSlot could be an empty slot.
+							float fx = tempVerts[0], fy = tempVerts[1];
+							if (fx < bmin.x) bmin.x = fx;
+							if (fx > bmax.x) bmax.x = fx;
+							if (fy < bmin.y) bmin.y = fy;
+							if (fy > bmax.y) bmax.y = fy;
+						}
+
 						for (int iii = 0; iii < meshVertexCount; iii += 2) {
 						for (int iii = 0; iii < meshVertexCount; iii += 2) {
 							float x = tempVerts[iii], y = tempVerts[iii + 1];
 							float x = tempVerts[iii], y = tempVerts[iii + 1];
 							verts[vi].x = x; verts[vi].y = y; verts[vi].z = z;
 							verts[vi].x = x; verts[vi].y = y; verts[vi].z = z;
@@ -314,8 +325,7 @@ namespace Spine.Unity.MeshGeneration {
 		/// <summary>Creates a UnityEngine.Bounds struct from minimum and maximum value vectors.</summary>
 		/// <summary>Creates a UnityEngine.Bounds struct from minimum and maximum value vectors.</summary>
 		public static Bounds ToBounds (Vector3 boundsMin, Vector3 boundsMax) {
 		public static Bounds ToBounds (Vector3 boundsMin, Vector3 boundsMax) {
 			Vector3 size = (boundsMax - boundsMin);
 			Vector3 size = (boundsMax - boundsMin);
-			Vector3 center = boundsMin + size * 0.5f;
-			return new Bounds(center, size);
+			return new Bounds((boundsMin + (size * 0.5f)), size);
 		}
 		}
 
 
 		#region TangentSolver2D
 		#region TangentSolver2D

+ 1 - 2
spine-unity/Assets/spine-unity/Modules/BoundingBoxFollower/BoundingBoxFollower.cs

@@ -47,7 +47,6 @@ namespace Spine.Unity {
 		string currentAttachmentName;
 		string currentAttachmentName;
 		PolygonCollider2D currentCollider;
 		PolygonCollider2D currentCollider;
 
 
-		bool valid = false;
 		bool hasReset;
 		bool hasReset;
 
 
 		public readonly Dictionary<BoundingBoxAttachment, PolygonCollider2D> colliderTable = new Dictionary<BoundingBoxAttachment, PolygonCollider2D>();
 		public readonly Dictionary<BoundingBoxAttachment, PolygonCollider2D> colliderTable = new Dictionary<BoundingBoxAttachment, PolygonCollider2D>();
@@ -128,7 +127,7 @@ namespace Spine.Unity {
 			}
 			}
 
 
 #if UNITY_EDITOR
 #if UNITY_EDITOR
-			valid = colliderTable.Count != 0;
+			bool valid = colliderTable.Count != 0;
 			if (!valid) {
 			if (!valid) {
 				if (this.gameObject.activeInHierarchy)
 				if (this.gameObject.activeInHierarchy)
 					Debug.LogWarning("Bounding Box Follower not valid! Slot [" + slotName + "] does not contain any Bounding Box Attachments!");
 					Debug.LogWarning("Bounding Box Follower not valid! Slot [" + slotName + "] does not contain any Bounding Box Attachments!");

+ 8 - 2
spine-unity/Assets/spine-unity/SkeletonExtensions.cs

@@ -130,6 +130,7 @@ namespace Spine {
 			drawOrder.Clear(false);
 			drawOrder.Clear(false);
 			drawOrder.GrowIfNeeded(n);
 			drawOrder.GrowIfNeeded(n);
 			System.Array.Copy(slotsItems, drawOrder.Items, n);
 			System.Array.Copy(slotsItems, drawOrder.Items, n);
+			drawOrder.Count = n;
 		}
 		}
 
 
 		/// <summary>Resets the color of a slot to Setup Pose value.</summary>
 		/// <summary>Resets the color of a slot to Setup Pose value.</summary>
@@ -149,8 +150,13 @@ namespace Spine {
 		/// <summary>Resets the attachment of slot at a given slotIndex to setup pose. This is faster than Slot.SetAttachmentToSetupPose.</summary>
 		/// <summary>Resets the attachment of slot at a given slotIndex to setup pose. This is faster than Slot.SetAttachmentToSetupPose.</summary>
 		public static void SetSlotAttachmentToSetupPose (this Skeleton skeleton, int slotIndex) {
 		public static void SetSlotAttachmentToSetupPose (this Skeleton skeleton, int slotIndex) {
 			var slot = skeleton.slots.Items[slotIndex];
 			var slot = skeleton.slots.Items[slotIndex];
-			var attachment = skeleton.GetAttachment(slotIndex, slot.data.attachmentName);
-			slot.Attachment = attachment;
+			// Based on Slot.SetToSetupPose
+			if (slot.data.attachmentName == null)
+				slot.Attachment = null;
+			else {
+				slot.attachment = null;
+				slot.Attachment = skeleton.GetAttachment(slotIndex, slot.data.attachmentName);
+			}
 		}
 		}
 
 
 		/// <summary>Resets Skeleton parts to Setup Pose according to a Spine.Animation's keyed items.</summary>
 		/// <summary>Resets Skeleton parts to Setup Pose according to a Spine.Animation's keyed items.</summary>

+ 4 - 2
spine-unity/Assets/spine-unity/SkeletonRenderer.cs

@@ -449,10 +449,12 @@ namespace Spine.Unity {
 
 
 				int oldSubmeshCount = submeshes.Count;
 				int oldSubmeshCount = submeshes.Count;
 
 
-				submeshes.Capacity = submeshCount;
+				if (submeshes.Capacity < submeshCount)
+					submeshes.Capacity = submeshCount;
 				for (int i = oldSubmeshCount; i < submeshCount; i++)
 				for (int i = oldSubmeshCount; i < submeshCount; i++)
 					submeshes.Items[i] = new ArraysMeshGenerator.SubmeshTriangleBuffer(workingSubmeshInstructions.Items[i].triangleCount);
 					submeshes.Items[i] = new ArraysMeshGenerator.SubmeshTriangleBuffer(workingSubmeshInstructions.Items[i].triangleCount);
-
+				submeshes.Count = submeshCount;
+					
 				var mutableTriangles = !workingInstruction.immutableTriangles;
 				var mutableTriangles = !workingInstruction.immutableTriangles;
 				for (int i = 0, last = submeshCount - 1; i < submeshCount; i++) {
 				for (int i = 0, last = submeshCount - 1; i < submeshCount; i++) {
 					var submeshInstruction = workingSubmeshInstructions.Items[i];
 					var submeshInstruction = workingSubmeshInstructions.Items[i];

+ 8 - 2
spine-unity/Assets/spine-unity/SkeletonUtility/Editor/SkeletonUtilityInspector.cs

@@ -98,13 +98,19 @@ namespace Spine.Unity.Editor {
 				return;
 				return;
 			}
 			}
 				
 				
+			var m = transform.localToWorldMatrix;
 			foreach (Bone b in skeleton.Bones) {
 			foreach (Bone b in skeleton.Bones) {
 				Vector3 pos = new Vector3(b.WorldX, b.WorldY, 0);
 				Vector3 pos = new Vector3(b.WorldX, b.WorldY, 0);
 				Quaternion rot = Quaternion.Euler(0, 0, b.WorldRotationX - 90f);
 				Quaternion rot = Quaternion.Euler(0, 0, b.WorldRotationX - 90f);
 				Vector3 scale = Vector3.one * b.Data.Length * b.WorldScaleX;
 				Vector3 scale = Vector3.one * b.Data.Length * b.WorldScaleX;
+				const float mx = 2.5f;
+				scale.x = Mathf.Clamp(scale.x, -mx, mx);
+				SpineEditorUtilities.DrawBone(m * Matrix4x4.TRS(pos, rot, scale));
+			}
 
 
-				SpineEditorUtilities.Icons.BoneMaterial.SetPass(0);
-				Graphics.DrawMeshNow(SpineEditorUtilities.Icons.BoneMesh, transform.localToWorldMatrix * Matrix4x4.TRS(pos, rot, scale));
+			foreach (Slot s in skeleton.DrawOrder) {
+				var p = s.Attachment as PathAttachment;
+				if (p != null) SpineEditorUtilities.DrawPath(s, p, transform);
 			}
 			}
 		}
 		}
 
 

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно