fix(scripting): stabilize mono wrapper test teardown

This commit is contained in:
2026-04-15 14:27:21 +08:00
parent 982a877714
commit 65cb212020
8 changed files with 351 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
using XCEngine;
namespace Gameplay
{
public sealed class CameraPropertyProbe : MonoBehaviour
{
public bool CameraLookupSucceeded;
public float ObservedFieldOfView;
public float ObservedNearClipPlane;
public float ObservedFarClipPlane;
public float ObservedDepth;
public bool ObservedPrimary;
public void Start()
{
CameraLookupSucceeded = TryGetComponent(out Camera camera);
if (camera == null)
{
CameraLookupSucceeded = false;
return;
}
ObservedFieldOfView = camera.fieldOfView;
ObservedNearClipPlane = camera.nearClipPlane;
ObservedFarClipPlane = camera.farClipPlane;
ObservedDepth = camera.depth;
ObservedPrimary = camera.primary;
camera.fieldOfView = 75.0f;
camera.nearClipPlane = 0.3f;
camera.farClipPlane = 500.0f;
camera.depth = 3.0f;
camera.primary = false;
}
}
}