Initial commit: AIGame Unity client with URP, HybridCLR, YooAsset and tooling.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
udx
2026-09-21 14:21:07 +08:00
co-authored by Cursor
commit f3f66ab063
931 changed files with 112366 additions and 0 deletions
@@ -0,0 +1,55 @@
using Unity.Pipeline.Commands;
using UnityEditor;
using UnityEngine;
namespace Unity.Pipeline.Editor.Commands
{
/// <summary>
/// Commands for controlling Unity Editor play mode state.
/// Enables automation workflows to control Editor play/stop/pause from CLI tools.
/// </summary>
static class PlayModeCommands
{
// TODO Pipeline: should all commands have name with namespace: editor.play build.generate instead of using _
[CliCommand("editor_play", "Enter Unity Editor play mode", Tags = new[] { "editor/playmode" })]
public static string EnterPlayMode()
{
if (EditorApplication.isPlaying)
{
Debug.LogWarning("Editor is already in play mode");
return "Already in play mode";
}
EditorApplication.isPlaying = true;
return "Entered play mode";
}
[CliCommand("editor_stop", "Exit Unity Editor play mode", Tags = new[] { "editor/playmode" })]
public static string ExitPlayMode()
{
if (!EditorApplication.isPlaying)
{
Debug.LogWarning("Editor is already in edit mode");
return "Already in edit mode";
}
EditorApplication.isPlaying = false;
return "Exited play mode";
}
[CliCommand("editor_pause", "Toggle pause state of Unity Editor play mode", Tags = new[] { "editor/playmode" })]
public static string PausePlayMode()
{
if (!EditorApplication.isPlaying)
{
Debug.LogWarning("Cannot pause - Editor is not in play mode");
return "Cannot pause - not in play mode";
}
EditorApplication.isPaused = !EditorApplication.isPaused;
string state = EditorApplication.isPaused ? "paused" : "unpaused";
return $"Play mode {state}";
}
}
}