RoleDress.ts 601 B

123456789101112131415
  1. export default class RoleDress {
  2. static colors = [
  3. {"legbig-y":2,"legsmall-b":1,"body-y":3,"hang-b":1},//red
  4. {"legbig-y":1,"legsmall-b":3,"body-y":1,"hang-b":3},//green
  5. {"legbig-y":0,"legsmall-b":2,"body-y":0,"hang-b":2},//yellow
  6. {"legbig-y":3,"legsmall-b":0 ,"body-y":2,"hang-b":0}//black
  7. ];
  8. static changeColor(armature:dragonBones.Armature, colorIndex:number){
  9. let roleColorInfo = this.colors[colorIndex];
  10. for(let slotName in roleColorInfo){
  11. armature.getSlot(slotName).displayIndex = roleColorInfo[slotName];
  12. }
  13. }
  14. }