Selaa lähdekoodia

[haxe] Port of commit cb48737 (partially - no copy constructor)

Davide Tantillo 1 vuosi sitten
vanhempi
commit
511dd0c1da

+ 6 - 5
spine-haxe/spine-haxe/spine/IkConstraint.hx

@@ -47,17 +47,18 @@ class IkConstraint implements Updatable {
 		if (skeleton == null)
 			throw new SpineException("skeleton cannot be null.");
 		_data = data;
-		mix = data.mix;
-		softness = data.softness;
-		bendDirection = data.bendDirection;
-		compress = data.compress;
-		stretch = data.stretch;
 
 		bones = new Array<Bone>();
 		for (boneData in data.bones) {
 			bones.push(skeleton.findBone(boneData.name));
 		}
 		target = skeleton.findBone(data.target.name);
+
+		mix = data.mix;
+		softness = data.softness;
+		bendDirection = data.bendDirection;
+		compress = data.compress;
+		stretch = data.stretch;
 	}
 
 	public function isActive():Bool {

+ 2 - 0
spine-haxe/spine-haxe/spine/PathConstraint.hx

@@ -62,11 +62,13 @@ class PathConstraint implements Updatable {
 		if (skeleton == null)
 			throw new SpineException("skeleton cannot be null.");
 		_data = data;
+
 		_bones = new Array<Bone>();
 		for (boneData in data.bones) {
 			_bones.push(skeleton.findBone(boneData.name));
 		}
 		target = skeleton.findSlot(data.target.name);
+
 		position = data.position;
 		spacing = data.spacing;
 		mixRotate = data.mixRotate;

+ 2 - 0
spine-haxe/spine-haxe/spine/PhysicsConstraint.hx

@@ -67,7 +67,9 @@ class PhysicsConstraint implements Updatable {
 	public function new(data: PhysicsConstraintData, skeleton: Skeleton) {
 		_data = data;
 		_skeleton = skeleton;
+
 		_bone = skeleton.bones[data.bone.index];
+
 		inertia = data.inertia;
 		strength = data.strength;
 		damping = data.damping;

+ 7 - 5
spine-haxe/spine-haxe/spine/TransformConstraint.hx

@@ -51,17 +51,19 @@ class TransformConstraint implements Updatable {
 		if (skeleton == null)
 			throw new SpineException("skeleton cannot be null.");
 		_data = data;
+
+		_bones = new Array<Bone>();
+		for (boneData in data.bones) {
+			_bones.push(skeleton.findBone(boneData.name));
+		}
+		target = skeleton.findBone(data.target.name);
+
 		mixRotate = data.mixRotate;
 		mixX = data.mixX;
 		mixY = data.mixY;
 		mixScaleX = data.mixScaleX;
 		mixScaleY = data.mixScaleY;
 		mixShearY = data.mixShearY;
-		_bones = new Array<Bone>();
-		for (boneData in data.bones) {
-			_bones.push(skeleton.findBone(boneData.name));
-		}
-		target = skeleton.findBone(data.target.name);
 	}
 
 	public function isActive():Bool {