adjust waiting to work around Oculus Rift black screenshot issue
This commit is contained in:
Родитель
fcf2f3ee67
Коммит
0bef9b4430
|
@ -9,6 +9,8 @@ using UnityEngine.XR;
|
|||
|
||||
public class GraphicsTests
|
||||
{
|
||||
bool check = true;
|
||||
|
||||
private string imageResultsPath;
|
||||
|
||||
[OneTimeSetUp()]
|
||||
|
@ -28,9 +30,15 @@ public class GraphicsTests
|
|||
[UseGraphicsTestCases]
|
||||
public IEnumerator Test1(GraphicsTestCase testCase)
|
||||
{
|
||||
SceneManager.LoadScene(testCase.ScenePath);
|
||||
var asyncLoad = SceneManager.LoadSceneAsync(testCase.ScenePath);
|
||||
|
||||
yield return null;
|
||||
yield return new WaitUntil(() => asyncLoad.isDone);
|
||||
|
||||
if(check)
|
||||
{
|
||||
yield return new WaitForSeconds(1);
|
||||
check = false;
|
||||
}
|
||||
|
||||
XRDevice.DisableAutoXRCameraTracking(Camera.main, true);
|
||||
|
||||
|
@ -39,8 +47,7 @@ public class GraphicsTests
|
|||
Assert.IsNotNull(testSettings, "No test settings script found, not a valid test");
|
||||
|
||||
Screen.SetResolution(testSettings.ImageComparisonSettings.TargetWidth, testSettings.ImageComparisonSettings.TargetHeight, false);
|
||||
|
||||
yield return SkipFrame(30);
|
||||
|
||||
yield return new WaitForEndOfFrame();
|
||||
|
||||
var screenShot = new Texture2D(0, 0, TextureFormat.RGBA32, false);
|
||||
|
@ -52,7 +59,7 @@ public class GraphicsTests
|
|||
|
||||
protected IEnumerator SkipFrame(int frames)
|
||||
{
|
||||
Debug.Log(("Skipping {0} frames.", frames));
|
||||
Debug.Log(string.Format("Skipping {0} frames.", frames));
|
||||
|
||||
for (int f = 0; f < frames; f++)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче