forked from Unity-Technologies/EntityComponentSystemSamples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStaticProblemSystem.cs
More file actions
35 lines (32 loc) · 1.05 KB
/
Copy pathStaticProblemSystem.cs
File metadata and controls
35 lines (32 loc) · 1.05 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
using Unity.Entities;
using Unity.Transforms;
namespace Samples.HelloNetcode
{
[WorldSystemFilter(WorldSystemFilterFlags.ServerSimulation)]
[UpdateInGroup(typeof(HelloNetcodeSystemGroup))]
[UpdateAfter(typeof(BarrelSpawnerSystem))]
public partial class StaticProblemSystem : SystemBase
{
protected override void OnCreate()
{
RequireForUpdate<EnableOptimization>();
}
protected override void OnUpdate()
{
var setup = SystemAPI.GetSingleton<BarrelSetup>();
if (!setup.EnableProblem)
{
Enabled = false;
}
#if !ENABLE_TRANSFORM_V1
/* This is intentionally incorrect. We grab write access to the transform data but never modify it. */
Entities.ForEach((ref LocalTransform trans) =>
#else
/* This is intentionally incorrect. We grab write access to the translation data but never modify it. */
Entities.ForEach((ref Translation trans) =>
#endif
{
}).Run();
}
}
}