fix: 编辑器报错 & 设置勇士朝向

This commit is contained in:
AncTe committed 2024-09-27 15:13:54 +08:00
1 parent 80f154694a
commit ac8a61558e
6 files changed
+28 -2

No files matched your search

+5
View File
@@ -65,6 +65,10 @@ export function init() {
return moveSteps;
}
function setHeroDirection(dir: Dir) {
if (!heroMover.moving) heroMover.moveDir = dir;
}
/**
* 生成跳跃函数
*/
@@ -164,6 +168,7 @@ export function init() {
}
if (name === 'direction') {
adapters['hero-adapter']?.sync('turn', value);
setHeroDirection(value as Dir);
} else if (name === 'x') {
adapters['hero-adapter']?.sync('setHeroLoc', value);
} else {