getBoneByName method

Bone? getBoneByName(
  1. String name
)

name - String to match to the Bone's .name property.

Searches through the skeleton's bone array and returns the first with a matching name.

Implementation

Bone? getBoneByName(String name) {
  for (int i = 0, il = bones.length; i < il; i++) {
    final bone = bones[i];

    if (bone.name == name) {
      return bone;
    }
  }

  return null;
}