Ejemplo n.º 1
0
        private IMRunner StartRunner <T>(INprRenderingPostProcessingDirector ppDirector) where T : IMRunner
        {
            IMRunner runner = GetComponent <T>();

            var runnerSupports = new List <IMRunnerSupport>();

            if (Configuration.UseImageTestingRunnerSupport)
            {
                runnerSupports.Add(GetComponent <MImageTestingRunnerSupportOC>());
            }
            if (Configuration.UseMeasurementRunnerSupport)
            {
                runnerSupports.Add(GetComponent <MMeasurementRunnerSupportOC>());
            }
            if (Configuration.UsePerformanceEvaluatorRunnerSupportOC)
            {
                runnerSupports.Add(GetComponent <MPerformanceEvaluatorRunnerSupportOC>());
            }

            if (Configuration.UseScreenshotTakingRunnerSupport)
            {
                var mScreenshotTakingRunnerSupportOc = GetComponent <MScreenshotTakingRunnerSupportOC>();
                mScreenshotTakingRunnerSupportOc.TakeScreenshotEveryNthFrame = Configuration.TakeScreenshotEveryNthFrame;
                runnerSupports.Add(mScreenshotTakingRunnerSupportOc);
            }

            runner.Enable(Configuration, ppDirector, runnerSupports);
            return(runner);
        }
Ejemplo n.º 2
0
        public void Start()
        {
            var cameraObject = gameObject;

            RemoveAdditionalComponentsFromHatchedObject();
            HatchedObject.GetComponent <MeshFilter>().mesh = Configuration.MeshToUse.MeshToUse;
            HatchedObject.transform.localScale             = Configuration.MeshToUse.Scale;
            var configurer = FindObjectOfType <HatchGeneratingEnviromentConfigurerOC>();
            var ppDirector = configurer.ConfigureEnviroment(Configuration.GeneratingMode, cameraObject, HatchedObject);

            HatchedObject.GetComponents <IOneTestConfigurationConsumer>()
            .ToList()
            .ForEach(c => c.ConsumeConfiguration(Configuration));

            ppDirector?.SetAutonomicRendering(false);

            _runner = StartRunner <MTestingRunnerGO>(ppDirector);
        }