您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

43 行
1.2 KiB

using UnityEngine;
using UnityEditor;
using UnityEngine.Rendering;
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
[TestFixture]
public class CullResultsTest
{
void InspectCullResults(Camera camera, CullResults cullResults, RenderLoop renderLoop)
{
VisibleReflectionProbe[] probes = cullResults.culledReflectionProbes;
Assert.AreEqual(1, probes.Length, "Incorrect reflection probe count");
VisibleReflectionProbe probeA = probes[0];
Assert.NotNull(probeA.texture, "probe texture");
ActiveLight[] lights = cullResults.culledLights;
Assert.AreEqual(3, lights.Length, "Incorrect light count");
LightType[] expectedTypes = new LightType[] { LightType.Directional, LightType.Spot, LightType.Point };
for (int i = 0; i != 2; i++)
{
Assert.AreEqual(expectedTypes[i], lights[i].lightType,
"Incorrect light type for light " + i.ToString() + " (" + lights[i].light.name + ")");
}
// @TODO..
}
[Test]
public void TestReflectionProbes()
{
UnityEditor.SceneManagement.EditorSceneManager.OpenScene("Assets/Editor/Tests/TestScene.unity");
// Asserts.ExpectLogError("Boing");
RenderLoopTestFixture.Run(InspectCullResults);
}
}