uloop-find-game-objects

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

uloop find-game-objects

uloop find-game-objects

Find GameObjects with search criteria or get currently selected objects.
根据搜索条件查找GameObject,或获取当前选中的对象。

Usage

使用方法

bash
uloop find-game-objects [options]
bash
uloop find-game-objects [options]

Parameters

参数

ParameterTypeDefaultDescription
--name-pattern
string-Name pattern to search
--search-mode
string
Contains
Search mode:
Exact
,
Path
,
Regex
,
Contains
,
Selected
--required-components
array-Required components
--tag
string-Tag filter
--layer
string-Layer filter
--max-results
integer
20
Maximum number of results
--include-inactive
boolean
false
Include inactive GameObjects
参数类型默认值描述
--name-pattern
string-要搜索的名称模式
--search-mode
string
Contains
搜索模式:
Exact
Path
Regex
Contains
Selected
--required-components
array-必需的组件
--tag
string-标签筛选器
--layer
string-层筛选器
--max-results
integer
20
最大结果数量
--include-inactive
boolean
false
包含非激活状态的GameObject

Search Modes

搜索模式

ModeDescription
Exact
Exact name match
Path
Hierarchy path search (e.g.,
Canvas/Button
)
Regex
Regular expression pattern
Contains
Partial name match (default)
Selected
Get currently selected GameObjects in Unity Editor
模式描述
Exact
精确名称匹配
Path
层级路径搜索(例如:
Canvas/Button
Regex
正则表达式模式
Contains
部分名称匹配(默认)
Selected
获取Unity编辑器中当前选中的GameObject

Global Options

全局选项

OptionDescription
--project-path <path>
Target a specific Unity project (mutually exclusive with
--port
). Path resolution follows the same rules as
cd
— absolute paths are used as-is, relative paths are resolved from cwd.
-p, --port <port>
Specify Unity TCP port directly (mutually exclusive with
--project-path
).
选项描述
--project-path <path>
指定目标Unity项目(与
--port
互斥)。路径解析遵循与
cd
相同的规则——绝对路径直接使用,相对路径从当前工作目录解析。
-p, --port <port>
直接指定Unity的TCP端口(与
--project-path
互斥)。

Examples

示例

bash
undefined
bash
undefined

Find by name

按名称查找

uloop find-game-objects --name-pattern "Player"
uloop find-game-objects --name-pattern "Player"

Find with component

按组件查找

uloop find-game-objects --required-components Rigidbody
uloop find-game-objects --required-components Rigidbody

Find by tag

按标签查找

uloop find-game-objects --tag "Enemy"
uloop find-game-objects --tag "Enemy"

Regex search

正则表达式搜索

uloop find-game-objects --name-pattern "UI_.*" --search-mode Regex
uloop find-game-objects --name-pattern "UI_.*" --search-mode Regex

Get selected GameObjects

获取选中的GameObject

uloop find-game-objects --search-mode Selected
uloop find-game-objects --search-mode Selected

Get selected including inactive

获取选中对象,包含非激活状态

uloop find-game-objects --search-mode Selected --include-inactive
undefined
uloop find-game-objects --search-mode Selected --include-inactive
undefined

Output

输出

Returns JSON with matching GameObjects.
For
Selected
mode with multiple objects, results are exported to file:
  • Single selection: JSON response directly
  • Multiple selection: File at
    .uloop/outputs/FindGameObjectsResults/
  • No selection: Empty results with message
返回包含匹配GameObject的JSON数据。
对于
Selected
模式下的多个对象,结果将导出到文件:
  • 单个选中对象:直接返回JSON响应
  • 多个选中对象:文件位于
    .uloop/outputs/FindGameObjectsResults/
  • 无选中对象:返回空结果及提示信息