@Pharan, We added 3 vars to skeletonUtilityBone which we poll.
public Vector2 m_StoredBonePos = Vector2.zero;
public bool m_DisablePositionChange = false;
public bool m_DidUpdate = false;
Where a component which we add to the root bone sets DisablePositionChange
to true
then in update we need store the bone pos and set back to 0
Doupdate()
{
...
float skeletonFlipRotation = (skeleton.flipX ^ skeleton.flipY) ? -1f : 1f;
if ((bone.x != 0 || bone.y != 0))//store
{
m_DidUpdate = true;
m_StoredBonePos = new Vector2(bone.x, bone.y);
}
...
if (position)
{
if (!m_DisablePositionChange)//check if it should move, if not reset it to 0
cachedTransform.localPosition = new Vector3(bone.x, bone.y, 0);
else
{
bone.x = 0;
bone.y = 0;
}
}
}
But you also need to turn off mixing between animations for the rootbone.
TranslateTimeline.Apply:
override public void Apply (Skeleton skeleton, float lastTime, float time, ExposedList<Event> firedEvents, float alpha, bool setupPose, bool mixingOut) {
Bone bone = skeleton.bones.Items[boneIndex];
if (boneIndex == 0)
alpha= 1;
...
12 Dec 2016, 10:07
now you can just plug into the stored position, and move the character by that amount