mirror of
http://junepve.top:3000/chicrobot/CINC.git
synced 2026-10-30 00:21:29 +08:00
feat(item) 优化移动及添加测试场景
This commit is contained in:
1 parent
2f7210f47e
commit
b9a5180293
15 files changed
+1428
-62
No files matched your search
@@ -16,6 +16,11 @@ export let activeUnit = null;
|
||||
// 初始值为空数组,表示没有选中任何单位
|
||||
export let selectedUnits = [];
|
||||
|
||||
// 相机锁定状态
|
||||
// 用于控制相机是否锁定到选中单位
|
||||
// 初始值为false,表示未锁定
|
||||
export let cameraLocked = false;
|
||||
|
||||
// 设置当前激活单位的函数
|
||||
// @param {Object} unit - 要设置为激活状态的单位对象
|
||||
export function setActiveUnit(unit) {
|
||||
@@ -41,4 +46,15 @@ export function clearSelection() {
|
||||
activeUnit = null;
|
||||
// 将选中的单位列表重置为空数组(取消所有选择)
|
||||
selectedUnits = [];
|
||||
// 取消相机锁定
|
||||
setCameraLocked(false);
|
||||
}
|
||||
|
||||
// 设置相机锁定状态的函数
|
||||
export function setCameraLocked(locked) {
|
||||
cameraLocked = locked;
|
||||
// 将锁定状态暴露到window对象上,以便InputSystem访问
|
||||
if (typeof window !== 'undefined') {
|
||||
window.cameraLocked = locked;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user