getNearestBone static method

dynamic getNearestBone(
  1. dynamic bone,
  2. dynamic names
)

Implementation

static getNearestBone(bone, names) {
  while (bone.isBone) {
    if (names.indexOf(bone.name) != -1) {
      return bone;
    }

    bone = bone.parent;
  }
}