|
@@ -52,26 +52,24 @@ namespace Spine {
|
|
public IkConstraint (IkConstraintData data, Skeleton skeleton) {
|
|
public IkConstraint (IkConstraintData data, Skeleton skeleton) {
|
|
if (data == null) throw new ArgumentNullException("data", "data cannot be null.");
|
|
if (data == null) throw new ArgumentNullException("data", "data cannot be null.");
|
|
this.data = data;
|
|
this.data = data;
|
|
- mix = data.mix;
|
|
|
|
- softness = data.softness;
|
|
|
|
- bendDirection = data.bendDirection;
|
|
|
|
- compress = data.compress;
|
|
|
|
- stretch = data.stretch;
|
|
|
|
|
|
|
|
bones = new ExposedList<Bone>(data.bones.Count);
|
|
bones = new ExposedList<Bone>(data.bones.Count);
|
|
foreach (BoneData boneData in data.bones)
|
|
foreach (BoneData boneData in data.bones)
|
|
bones.Add(skeleton.bones.Items[boneData.index]);
|
|
bones.Add(skeleton.bones.Items[boneData.index]);
|
|
|
|
|
|
target = skeleton.bones.Items[data.target.index];
|
|
target = skeleton.bones.Items[data.target.index];
|
|
|
|
+
|
|
|
|
+ mix = data.mix;
|
|
|
|
+ softness = data.softness;
|
|
|
|
+ bendDirection = data.bendDirection;
|
|
|
|
+ compress = data.compress;
|
|
|
|
+ stretch = data.stretch;
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>Copy constructor.</summary>
|
|
/// <summary>Copy constructor.</summary>
|
|
- public IkConstraint (IkConstraint constraint) {
|
|
|
|
- if (constraint == null) throw new ArgumentNullException("constraint", "constraint cannot be null.");
|
|
|
|
- data = constraint.data;
|
|
|
|
- bones = new ExposedList<Bone>(constraint.Bones.Count);
|
|
|
|
- bones.AddRange(constraint.Bones);
|
|
|
|
- target = constraint.target;
|
|
|
|
|
|
+ public IkConstraint (IkConstraint constraint, Skeleton skeleton)
|
|
|
|
+ : this(constraint.data, skeleton) {
|
|
|
|
+
|
|
mix = constraint.mix;
|
|
mix = constraint.mix;
|
|
softness = constraint.softness;
|
|
softness = constraint.softness;
|
|
bendDirection = constraint.bendDirection;
|
|
bendDirection = constraint.bendDirection;
|