示例#1
0
        // ------------------------------------------------------------------------------------
        // ResultsViewer

        // ------------------------------------------------------------------------------------
        // This sections controls customizing the ResultsViewers context object for this test type
        //
        // Mandatory overrides:
        // - SetupResultsContext
        // This method lets you specify the content of the results viewer context object
        // Input is an array of game object references
        // Context object contents are unique to the test type
        //
        // These method calls are already wrapped in debugs and as such do not require debugs inside them
        // However, should you want to add further debugs please use Console.Write()

        // Setup the results context object
        public override void SetupResultsContext(ResultsContext context, ResultsIOData inputData)
        {
            ExampleResults inputResults = (ExampleResults)logic.DeserializeResults(inputData);                               // Deserialize input and cast to typed results

            ExampleLogic.ComparisonData comparisonData = (ExampleLogic.ComparisonData)logic.GetComparisonData(inputResults); // Get comparison data
            context.objects[0].GetComponent <Text>().text = inputResults.SomeFloat.ToString();                               // Set float
            context.objects[1].GetComponent <Text>().text = comparisonData.SomeFloatDiff.ToString();                         // Set diff
        }
示例#2
0
        // Setup the results context object
        public override void SetupResultsContext(ResultsContext context, ResultsIOData inputData, ResultsIOData inputDataB)
        {
            ExampleResults inputResults = (ExampleResults)logic.DeserializeResults(inputData); // Deserialize input and cast to typed results

            if (TestRunner.Instance)
            {
                if (!TestRunner.Instance.isAnalytic)
                {
                    comparisonData = (ExampleComparison)logic.ProcessComparison(inputResults); // Get comparison data
                }
                else
                {
                    ExampleResults inputResultsB = (ExampleResults)logic.DeserializeResults(inputDataB); // Deserialize input and cast to typed results
                    comparisonData = (ExampleComparison)logic.ProcessComparison(inputResultsB, inputResults);
                }
            }
            else
            {
                comparisonData = (ExampleComparison)logic.ProcessComparison(inputResults); // Get comparison data
            }

            context.objects[0].GetComponent <Text>().text = inputResults.SomeFloat.ToString();       // Set float
            context.objects[1].GetComponent <Text>().text = comparisonData.SomeFloatDiff.ToString(); // Set diff
        }