mirror of
http://junepve.top:3000/chicrobot/CINC.git
synced 2026-10-30 01:41:29 +08:00
feat(control) 小地图
This commit is contained in:
1 parent
f86e5f3a79
commit
e2bc630d6d
8 files changed
+339
-24
No files matched your search
@@ -11,14 +11,20 @@ export class CommandSystem {
|
||||
}
|
||||
|
||||
onMoveRelative(dir) {
|
||||
if (activeUnit) {
|
||||
activeUnit.moveRelative(dir.x, dir.y);
|
||||
}
|
||||
const targets = selectedUnits.length > 0 ? selectedUnits : (activeUnit ? [activeUnit] : []);
|
||||
|
||||
targets.forEach(unit => {
|
||||
unit.moveRelative(dir.x, dir.y);
|
||||
});
|
||||
}
|
||||
|
||||
onMoveToPoint(x, y) {
|
||||
const targets = selectedUnits.length > 0 ? selectedUnits : (activeUnit ? [activeUnit] : []);
|
||||
targets.forEach(unit => unit.moveTo(x, y));
|
||||
|
||||
|
||||
targets.forEach(unit => {
|
||||
unit.setTarget(x, y); // ← 使用新接口
|
||||
});
|
||||
}
|
||||
|
||||
onSelectUnit(unit) {
|
||||
|
||||
Reference in new issue
Block a user