微件:Chibi:修订间差异
跳转到导航
跳转到搜索
无编辑摘要 |
无编辑摘要 |
||
第44行: | 第44行: | ||
//设定skin | //设定skin | ||
chibi.skeleton.setSkinByName('normal'); | if (chibi.skeleton.data.findSkin('normal') != null) | ||
chibi.skeleton.setSkinByName('normal'); | |||
else chibi.skeleton.setSkinByName('default'); | |||
chibi.skeleton.setSlotsToSetupPose(); | chibi.skeleton.setSlotsToSetupPose(); | ||
第111行: | 第113行: | ||
function changeSkin() { | function changeSkin() { | ||
const currentSkinName = chibi.skeleton.skin.name; | const currentSkinName = chibi.skeleton.skin.name; | ||
let newSkinName = 'default'; | |||
if (currentSkinName === 'normal') newSkinName = 'damage'; | |||
if (currentSkinName === 'damage') newSkinName = 'normal'; | |||
chibi.skeleton.setSkinByName(newSkinName); | chibi.skeleton.setSkinByName(newSkinName); | ||
chibi.skeleton.setSlotsToSetupPose(); | chibi.skeleton.setSlotsToSetupPose(); |