forked from Unity-Technologies/EntityComponentSystemSamples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathManySystemsMenu.cs
More file actions
44 lines (42 loc) · 1.87 KB
/
Copy pathManySystemsMenu.cs
File metadata and controls
44 lines (42 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System.IO;
using UnityEditor;
static class ManySystemsMenu
{
[MenuItem("DOTS/StressTests ManySystems/Generate Systems C# Files")]
private static void DOTS_StressTestsManySystems_GenerateSystemsCSharpFiles()
{
const int countSystems = 1000;
var linearSystemsPath = "Assets/StressTests/ManySystems_Linear/ManySystems_Linear_Bootstrap_Systems.cs";
using (var stream = new StreamWriter(linearSystemsPath))
{
stream.WriteLine("using Unity.Entities;");
stream.WriteLine("namespace StressTests.ManySystems");
stream.WriteLine("{");
var systems = new string[] { "TestSystem_Schedule", "TestSystem_Run", "TestSystem_ScheduleReader", "TestSystem_RunReader" };
for (var i = 0; i < countSystems; ++i)
{
foreach (var s in systems)
{
stream.WriteLine($" [UpdateInGroup(typeof(SimulationSystemGroup)), DisableAutoCreation, AlwaysUpdateSystem] class {s}_{i:0000} : {s} {{ }}");
}
}
stream.WriteLine("}");
}
var complexSystemsPath = "Assets/StressTests/ManySystems_Complex/ManySystems_Complex_Bootstrap_Systems.cs";
using (var stream = new StreamWriter(complexSystemsPath))
{
stream.WriteLine("using Unity.Entities;");
stream.WriteLine("namespace StressTests.ManySystems");
stream.WriteLine("{");
var systems = new string[] { "TestSystem_Complex" };
for (var i = 0; i < countSystems; ++i)
{
foreach (var s in systems)
{
stream.WriteLine($" [UpdateInGroup(typeof(SimulationSystemGroup)), DisableAutoCreation, AlwaysUpdateSystem] class {s}_{i:0000} : {s} {{ }}");
}
}
stream.WriteLine("}");
}
}
}