You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: UnityMcpBridge/UnityMcpServer~/src/tools/manage_script.py
+11-12Lines changed: 11 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -92,12 +92,12 @@ def apply_text_edits(
92
92
ctx: Context,
93
93
uri: Annotated[str, "URI of the script to edit under Assets/ directory, unity://path/Assets/... or file://... or Assets/..."],
94
94
edits: Annotated[list[dict[str, Any]], "List of edits to apply to the script, i.e. a list of {startLine,startCol,endLine,endCol,newText} (1-indexed!)"],
95
-
precondition_sha256: Annotated[str|None,
96
-
"Optional SHA256 of the script to edit, used to prevent concurrent edits"] =None,
97
-
strict: Annotated[bool|None,
98
-
"Optional strict flag, used to enforce strict mode"] =None,
99
-
options: Annotated[dict[str, Any]|None,
100
-
"Optional options, used to pass additional options to the script editor"] =None,
95
+
precondition_sha256: Annotated[str,
96
+
"Optional SHA256 of the script to edit, used to prevent concurrent edits"] |None=None,
97
+
strict: Annotated[bool,
98
+
"Optional strict flag, used to enforce strict mode"] |None=None,
99
+
options: Annotated[dict[str, Any],
100
+
"Optional options, used to pass additional options to the script editor"] |None=None,
101
101
) ->dict[str, Any]:
102
102
ctx.info(f"Processing apply_text_edits: {uri}")
103
103
name, directory=_split_uri(uri)
@@ -370,8 +370,8 @@ def create_script(
370
370
ctx: Context,
371
371
path: Annotated[str, "Path under Assets/ to create the script at, e.g., 'Assets/Scripts/My.cs'"],
372
372
contents: Annotated[str, "Contents of the script to create. Note, this is Base64 encoded over transport."],
373
-
script_type: Annotated[str|None, "Script type (e.g., 'C#')"] =None,
374
-
namespace: Annotated[str|None, "Namespace for the script"] =None,
373
+
script_type: Annotated[str, "Script type (e.g., 'C#')"]|None=None,
374
+
namespace: Annotated[str, "Namespace for the script"]|None=None,
375
375
) ->dict[str, Any]:
376
376
ctx.info(f"Processing create_script: {path}")
377
377
name=os.path.splitext(os.path.basename(path))[0]
@@ -460,10 +460,9 @@ def manage_script(
460
460
path: Annotated[str, "Asset path (default: 'Assets/')", "Path under Assets/ to create the script at, e.g., 'Assets/Scripts/My.cs'"],
461
461
contents: Annotated[str, "Contents of the script to create",
462
462
"C# code for 'create'/'update'"] |None=None,
463
-
script_type: Annotated[str|None,
464
-
"Script type (e.g., 'C#')", "Type hint (e.g., 'MonoBehaviour')"] |None=None,
465
-
namespace: Annotated[str|None, "Namespace for the script",
466
-
"Script namespace"] |None=None,
463
+
script_type: Annotated[str, "Script type (e.g., 'C#')",
464
+
"Type hint (e.g., 'MonoBehaviour')"] |None=None,
465
+
namespace: Annotated[str, "Namespace for the script"] |None=None,
0 commit comments