docs: Add documentation for get_components action in manage_gameobject
- Add get_components to the list of available actions in the docstring - Document required and optional parameters for get_components action - Clarify the return value structure for get_components - Improve overall documentation clarity for component data retrievalmain
parent
3063d54071
commit
47bb2c6363
|
|
@ -40,7 +40,7 @@ def register_manage_gameobject_tools(mcp: FastMCP):
|
|||
"""Manages GameObjects: create, modify, delete, find, and component operations.
|
||||
|
||||
Args:
|
||||
action: Operation (e.g., 'create', 'modify', 'find', 'add_component', 'remove_component', 'set_component_property').
|
||||
action: Operation (e.g., 'create', 'modify', 'find', 'add_component', 'remove_component', 'set_component_property', 'get_components').
|
||||
target: GameObject identifier (name or path string) for modify/delete/component actions.
|
||||
search_method: How to find objects ('by_name', 'by_id', 'by_path', etc.). Used with 'find' and some 'target' lookups.
|
||||
name: GameObject name - used for both 'create' (initial name) and 'modify' (rename).
|
||||
|
|
@ -62,8 +62,16 @@ def register_manage_gameobject_tools(mcp: FastMCP):
|
|||
search_term, find_all for 'find').
|
||||
includeNonPublicSerialized: If True, includes private fields marked [SerializeField] in component data.
|
||||
|
||||
Action-specific details:
|
||||
- For 'get_components':
|
||||
Required: target, search_method
|
||||
Optional: includeNonPublicSerialized (defaults to True)
|
||||
Returns all components on the target GameObject with their serialized data.
|
||||
The search_method parameter determines how to find the target ('by_name', 'by_id', 'by_path').
|
||||
|
||||
Returns:
|
||||
Dictionary with operation results ('success', 'message', 'data').
|
||||
For 'get_components', the 'data' field contains a dictionary of component names and their serialized properties.
|
||||
"""
|
||||
try:
|
||||
# --- Early check for attempting to modify a prefab asset ---
|
||||
|
|
|
|||
Loading…
Reference in New Issue