Beispiel #1
0
        public void DestroyTestAssets()
        {
            var window = EditorWindow.GetWindow <VFXViewWindow>();

            window.Close();
            VFXTestCommon.DeleteAllTemporaryGraph();
        }
Beispiel #2
0
        public void CleanUp()
        {
            File.WriteAllText(s_Modify_SG_Property_VFX, m_Modify_SG_Property_VFX);
            File.WriteAllText(s_Modify_SG_Property_SG_A, m_Modify_SG_Property_SG_A);
            File.WriteAllText(s_Modify_SG_Property_SG_B, m_Modify_SG_Property_SG_B);

            VFXTestCommon.DeleteAllTemporaryGraph();
        }
        public void CleanUp()
        {
            UnityEngine.VFX.VFXManager.fixedTimeStep = m_previousFixedTimeStep;
            UnityEngine.VFX.VFXManager.maxDeltaTime  = m_previousMaxDeltaTime;
            VFXTestCommon.DeleteAllTemporaryGraph();

            UnityEngine.Object.DestroyImmediate(m_gameObject);
            UnityEngine.Object.DestroyImmediate(m_camera);
        }
Beispiel #4
0
        public void DestroyTestAssets()
        {
            VFXViewWindow window = EditorWindow.GetWindow <VFXViewWindow>();

            window.Close();

            for (int i = 0; i < testAssetCount; ++i)
            {
                DestroyTestAsset("GUITest" + i);
            }

            VFXTestCommon.DeleteAllTemporaryGraph();
        }
Beispiel #5
0
        //[UnityTest] Not really a test but helper to profile the controller invalidation.
        public IEnumerator ExperimentCreateAllBlocksTiming([ValueSource(nameof(kApplyChange))] bool applyChanges, [ValueSource(nameof(kApplyChange))] bool blocks)
        {
            var referenceBlock    = VFXLibrary.GetBlocks().Where(t => t.model is Block.KillSphere).First();
            var referenceOperator = VFXLibrary.GetOperators().Where(t => t.model is Operator.DistanceToSphere).First();
            var referenceContext  = VFXLibrary.GetContexts().Where(t => t.model is VFXBasicUpdate).First();

            var param = new CreateAllBlockParam()
            {
                name        = "Test",
                destContext = referenceContext
            };

            var results = new List <(int, double)>();

            int modelCount = 1;

            while (modelCount < 512)
            {
                var watch = new System.Diagnostics.Stopwatch();
                watch.Start();

                if (modelCount >= 256)
                {
                    modelCount += 128;
                }
                else
                {
                    modelCount *= 2;
                }

                var controller = StartEditTestAsset();

                if (blocks)
                {
                    param.blocks = Enumerable.Repeat(referenceBlock, modelCount);
                    CreateAllBlocksExperiment(controller, param.destContext, param.blocks, applyChanges);
                }
                else
                {
                    var operators = Enumerable.Repeat(referenceOperator, modelCount);
                    CreateAllOperatorsExperiment(controller, operators, applyChanges);
                }

                watch.Stop();
                var stopwatchElapsed = watch.Elapsed;
                results.Add((modelCount, stopwatchElapsed.TotalMilliseconds));

                //Clean up for next experiment
                System.GC.Collect();
                var window = EditorWindow.GetWindow <VFXViewWindow>();
                window.Close();
                VFXTestCommon.DeleteAllTemporaryGraph();

                for (int i = 0; i < 8; ++i)
                {
                    yield return(null);
                }
            }

            var report = new System.Text.StringBuilder();

            report.AppendFormat("ApplyChange : {0} - {1}", applyChanges, blocks ? "Blocks" : "Operators");
            report.AppendLine();
            foreach (var result in results)
            {
                report.AppendFormat("{0};{1}", result.Item1, result.Item2);
                report.AppendLine();
            }
            Debug.Log(report);
        }