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,56 @@
using NUnit.Framework;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Unity.Pipeline;
using Unity.Pipeline.Models;
namespace Unity.Pipeline.Tests.Editor.Models
{
/// <summary>
/// Tests that <see cref="ObjectRefConverter"/> binds handle-object keys case-INSENSITIVELY
/// (CLI-220 follow-up). Agents frequently send "instanceID"/"fileID" (capital D); a case-sensitive
/// lookup dropped those into an empty handle, which then resolved to nothing while the calling
/// command still reported success.
/// </summary>
class ObjectRefConverterTests
{
private static ObjectRef Parse(string json) => JsonConvert.DeserializeObject<ObjectRef>(json);
[Test]
public void CapitalInstanceID_BindsToInstanceId()
{
var r = Parse("{\"instanceID\": 53816}");
Assert.IsNotNull(r);
Assert.AreEqual(ObjectId.FromRaw(53816), r.InstanceId, "capital 'instanceID' should bind to InstanceId");
Assert.IsFalse(r.IsEmpty, "the handle must not be empty");
}
[Test]
public void LowercaseInstanceId_StillBinds()
{
Assert.AreEqual(ObjectId.FromRaw(1234), Parse("{\"instanceId\": 1234}").InstanceId);
}
[Test]
public void CapitalFileID_AndGuid_Bind()
{
var r = Parse("{\"guid\":\"abc123\",\"fileID\": 99}");
Assert.AreEqual("abc123", r.Guid);
Assert.AreEqual(99L, r.FileId, "capital 'fileID' should bind to FileId");
}
[Test]
public void BareInteger_IsInstanceId()
{
var r = JToken.Parse("48184").ToObject<ObjectRef>();
Assert.AreEqual(ObjectId.FromRaw(48184), r.InstanceId);
}
[Test]
public void StringHandles_Path_And_Hierarchy()
{
Assert.AreEqual("Assets/Foo.mat", Parse("\"Assets/Foo.mat\"").Path, "Assets/ string is a path");
Assert.AreEqual("/Player", Parse("\"/Player\"").HierarchyPath, "leading-slash string is a hierarchy path");
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7eebd6cc31868e74b95575f9b62729a2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: