Release v0.1.3

This commit is contained in:
winlifes
2026-05-11 05:30:48 -07:00
parent a903f7f0af
commit 69ab5710f6
9 changed files with 169 additions and 21 deletions
+28
View File
@@ -157,6 +157,32 @@ function selectAsset(uuid) {
return { selected: true, uuid };
}
function selectNode(uuid) {
if (!global.Editor || !Editor.Selection || typeof Editor.Selection.select !== 'function') {
throw new Error('Editor.Selection.select is unavailable in this Cocos environment.');
}
Editor.Selection.clear('node');
Editor.Selection.select('node', uuid);
return { selected: true, uuid };
}
function clearSelection(type) {
if (!global.Editor || !Editor.Selection || typeof Editor.Selection.clear !== 'function') {
throw new Error('Editor.Selection.clear is unavailable in this Cocos environment.');
}
const normalized = String(type || 'all').trim().toLowerCase();
if (normalized === 'asset' || normalized === 'node') {
Editor.Selection.clear(normalized);
return { cleared: true, type: normalized };
}
Editor.Selection.clear('asset');
Editor.Selection.clear('node');
return { cleared: true, type: 'all' };
}
function getCurrentSelection() {
if (!global.Editor || !Editor.Selection || typeof Editor.Selection.getSelected !== 'function') {
throw new Error('Editor.Selection API is unavailable in this Cocos environment.');
@@ -170,6 +196,7 @@ function getCurrentSelection() {
}
module.exports = {
clearSelection,
deleteAsset,
getCurrentSelection,
listAssets,
@@ -179,4 +206,5 @@ module.exports = {
queryAssetMeta,
queryAssetUrl,
selectAsset,
selectNode,
};