AgentSkillsCN

uloop-find-game-objects

在场景中查找特定的GameObject。适用于按名称搜索对象、寻找具有特定组件的对象、定位带标签或分层的对象、获取Unity编辑器中当前选中的GameObject,或当用户要求查找GameObject时使用。返回匹配的GameObject及其路径与组件。

SKILL.md
--- frontmatter
name: uloop-find-game-objects
description: "Find specific GameObjects in scene. Use when: searching for objects by name, finding objects with specific components, locating tagged/layered objects, getting currently selected GameObjects in Unity Editor, or when user asks to find GameObjects. Returns matching GameObjects with paths and components."

uloop find-game-objects

Find GameObjects with search criteria or get currently selected objects.

Usage

bash
uloop find-game-objects [options]

Parameters

ParameterTypeDefaultDescription
--name-patternstring-Name pattern to search
--search-modestringContainsSearch mode: Exact, Path, Regex, Contains, Selected
--required-componentsarray-Required components
--tagstring-Tag filter
--layerstring-Layer filter
--max-resultsinteger20Maximum number of results
--include-inactivebooleanfalseInclude inactive GameObjects

Search Modes

ModeDescription
ExactExact name match
PathHierarchy path search (e.g., Canvas/Button)
RegexRegular expression pattern
ContainsPartial name match (default)
SelectedGet currently selected GameObjects in Unity Editor

Examples

bash
# Find by name
uloop find-game-objects --name-pattern "Player"

# Find with component
uloop find-game-objects --required-components Rigidbody

# Find by tag
uloop find-game-objects --tag "Enemy"

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

# Get selected GameObjects
uloop find-game-objects --search-mode Selected

# Get selected including inactive
uloop find-game-objects --search-mode Selected --include-inactive

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