fix(scripting): stabilize mono wrapper test teardown
This commit is contained in:
36
managed/GameScripts/CameraPropertyProbe.cs
Normal file
36
managed/GameScripts/CameraPropertyProbe.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user