1
- using Unity . Cinemachine ;
2
1
using System ;
3
2
using System . Collections ;
4
3
using System . Collections . Generic ;
@@ -18,10 +17,7 @@ public class PerformanceTestStage
18
17
19
18
[ FormerlySerializedAs ( "SceneName" ) ]
20
19
public string sceneName ;
21
-
22
- // TODO: Remove followings
23
- public Vector3 cameraPosition ;
24
- public Quaternion cameraRotation ;
20
+
25
21
public bool useFullTimeline = true ;
26
22
// ENDTODO
27
23
@@ -30,7 +26,6 @@ public class PerformanceTestStage
30
26
31
27
private int _recordingIndex = 0 ;
32
28
33
- private Camera _testCamera => PerformanceTest . instance . testCamera ;
34
29
private Action _finishedAction ;
35
30
private PlayableDirector _playableDirector ;
36
31
private float _intermediateCaptureTime ;
@@ -251,10 +246,6 @@ IEnumerator LoadAndInit()
251
246
status = TestStageStatus . Warming ;
252
247
_cancelButton . text = "Stop" ;
253
248
254
- // Debug.Log($"Start test {sceneName}");
255
-
256
- _testCamera . transform . position = cameraPosition ;
257
- _testCamera . transform . rotation = cameraRotation ;
258
249
259
250
// Debug.Log($"Load Scene {sceneName}");
260
251
@@ -266,9 +257,7 @@ IEnumerator LoadAndInit()
266
257
267
258
yield return null ;
268
259
PerformanceTest . instance . RefreshEventSystem ( ) ;
269
-
270
- DisableCamerasInScene ( ) ;
271
-
260
+
272
261
var directors = Resources . FindObjectsOfTypeAll < PlayableDirector > ( ) ;
273
262
274
263
// Debug.Log($"Found {directors.Length} playable director(s) in the scene {SceneManager.GetActiveScene().name}");
@@ -281,13 +270,7 @@ IEnumerator LoadAndInit()
281
270
if ( _playableDirector != null )
282
271
{
283
272
_playableDirector . gameObject . SetActive ( true ) ;
284
- var playable = _playableDirector . playableAsset ;
285
- if ( playable . outputs . Any ( o => o . outputTargetType == typeof ( CinemachineBrain ) ) )
286
- {
287
- var cinemachineTrack = playable . outputs . Single ( o => o . outputTargetType == typeof ( CinemachineBrain ) ) . sourceObject ;
288
- _playableDirector . SetGenericBinding ( cinemachineTrack , _testCamera . GetComponent < CinemachineBrain > ( ) ) ;
289
- }
290
-
273
+
291
274
var duration = ( float ) _playableDirector . duration ;
292
275
_intermediateCaptureTime = duration / ( PerformanceTest . instance . _framesToCapture + 1 ) ;
293
276
@@ -431,18 +414,6 @@ void Cancel()
431
414
_cancelButton . clicked -= Cancel ;
432
415
}
433
416
434
- private void DisableCamerasInScene ( )
435
- {
436
- foreach ( var camera in UnityEngine . Object . FindObjectsByType < Camera > ( FindObjectsSortMode . None ) )
437
- {
438
- // Debug.Log("Found camera: " + camera.gameObject.name);
439
- if ( camera . gameObject != _testCamera . gameObject )
440
- {
441
- camera . enabled = false ;
442
- }
443
- }
444
- }
445
-
446
417
public void RefreshDisplayedData ( )
447
418
{
448
419
if
0 commit comments