17 lines
468 B
JavaScript
17 lines
468 B
JavaScript
cc.Class({
|
|
extends: cc.Component,
|
|
properties: {},
|
|
start: function () {
|
|
var e = this.node.getComponent(sp.Skeleton);
|
|
this.changeCloth(e, "Leg_R2", "Leg", "update/Leg_L");
|
|
},
|
|
changeCloth: function (e, o, t, i) {
|
|
console.log("change cloth:", o, t, i);
|
|
var n = e.findSlot(o);
|
|
var a = e.skeletonData.getRuntimeData();
|
|
var c = a.findSkin(t);
|
|
var s = a.findSlotIndex(o);
|
|
var l = c.getAttachment(s, i);
|
|
n.setAttachment(l);
|
|
}
|
|
}); |