MCPcopy Create free account
hub / github.com/bigdra50/unity-cli / delete

Method delete

unity_cli/api/gameobject.py:133–152  ·  view source on GitHub ↗

Delete GameObject. Args: name: GameObject name to delete instance_id: Instance ID to delete Returns: Dictionary with operation result

(
        self,
        name: str | None = None,
        instance_id: int | None = None,
    )

Source from the content-addressed store, hash-verified

131 return self._conn.send_request("gameobject", params)
132
133 def delete(
134 self,
135 name: str | None = None,
136 instance_id: int | None = None,
137 ) -> dict[str, Any]:
138 """Delete GameObject.
139
140 Args:
141 name: GameObject name to delete
142 instance_id: Instance ID to delete
143
144 Returns:
145 Dictionary with operation result
146 """
147 params: dict[str, Any] = {"action": "delete"}
148 if name:
149 params["name"] = name
150 if instance_id is not None:
151 params["id"] = instance_id
152 return self._conn.send_request("gameobject", params)

Callers 7

test_delete_existingMethod · 0.45
test_modify_positionMethod · 0.45
snapshot_deleteFunction · 0.45
gameobject_deleteFunction · 0.45

Calls 1

send_requestMethod · 0.80

Tested by 5

test_delete_existingMethod · 0.36
test_modify_positionMethod · 0.36