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

36 行
1.2 KiB

using UnityEngine;
using UnityEngine.Experimental.Rendering;
using NUnit.Framework;
[TestFixture]
public class CullResultsTest
{
void InspectCullResults(Camera camera, CullResults cullResults, ScriptableRenderContext renderContext)
{
VisibleReflectionProbe[] probes = cullResults.visibleReflectionProbes.ToArray();
Assert.AreEqual(1, probes.Length, "Incorrect reflection probe count");
VisibleReflectionProbe probeA = probes[0];
Assert.NotNull(probeA.texture, "probe texture");
VisibleLight[] lights = cullResults.visibleLights.ToArray();
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/Tests/RenderloopTests/Editor/TestScene.unity");
RenderLoopTestFixtureInstance.Run(InspectCullResults);
}
}