And we find in the Spine-WebGL runtime, we do not need to calculate those values.
let texture = assetManager.require("head.png");
let textureRegion = {
texture: texture,
u: 0, v: 0, u2: 1, v2: 1,
width: texture.getImage().width, height: texture.getImage().height,
degrees: 0,
offsetX: 0, offsetY: 0,
originalWidth: texture.getImage().width, originalHeight: texture.getImage().height
};
let headSlot = this.skeleton.findSlot("head");
let newHeadAttachment = headSlot.getAttachment().copy();
newHeadAttachment.region = textureRegion;
newHeadAttachment.updateRegion();
headSlot.setAttachment(newHeadAttachment);