mirror of
http://junepve.top:3000/chicrobot/CINC.git
synced 2026-10-30 02:51:29 +08:00
24 lines
489 B
JavaScript
24 lines
489 B
JavaScript
export const CONTROL_MODE = {
|
|
SINGLE: 'single',
|
|
GROUP: 'group',
|
|
JOYSTICK: 'joystick'
|
|
};
|
|
|
|
export let activeUnit = null;
|
|
export let selectedUnits = [];
|
|
|
|
export function setActiveUnit(unit) {
|
|
activeUnit = unit;
|
|
// 不再重置selectedUnits数组,这样可以同时选中多个单位
|
|
}
|
|
|
|
export function addToSelection(unit) {
|
|
if (!selectedUnits.includes(unit)) {
|
|
selectedUnits.push(unit);
|
|
}
|
|
}
|
|
|
|
export function clearSelection() {
|
|
activeUnit = null;
|
|
selectedUnits = [];
|
|
} |