mirror of
http://junepve.top:3000/chicrobot/CINC.git
synced 2026-10-30 01:31:29 +08:00
feat(control) 多角色控制
This commit is contained in:
1 parent
be5ee91328
commit
f86e5f3a79
11 files changed
+431
No files matched your search
@@ -0,0 +1,24 @@
|
||||
export const CONTROL_MODE = {
|
||||
SINGLE: 'single',
|
||||
GROUP: 'group',
|
||||
JOYSTICK: 'joystick'
|
||||
};
|
||||
|
||||
export let activeUnit = null;
|
||||
export let selectedUnits = [];
|
||||
|
||||
export function setActiveUnit(unit) {
|
||||
activeUnit = unit;
|
||||
selectedUnits = unit ? [unit] : [];
|
||||
}
|
||||
|
||||
export function addToSelection(unit) {
|
||||
if (!selectedUnits.includes(unit)) {
|
||||
selectedUnits.push(unit);
|
||||
}
|
||||
}
|
||||
|
||||
export function clearSelection() {
|
||||
activeUnit = null;
|
||||
selectedUnits = [];
|
||||
}
|
||||
Reference in new issue
Block a user