forked from Unity-Technologies/EntityComponentSystemSamples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDecorationRenderSystem.cs
More file actions
24 lines (23 loc) · 850 Bytes
/
Copy pathDecorationRenderSystem.cs
File metadata and controls
24 lines (23 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using Unity.Entities;
using Unity.Transforms;
using UnityEngine;
namespace Streaming.RuntimeContentManager
{
// render entities that are loaded and should render
[WorldSystemFilter(WorldSystemFilterFlags.Default | WorldSystemFilterFlags.Editor)]
[UpdateInGroup(typeof(PresentationSystemGroup))]
public partial struct DecorationRenderSystem : ISystem
{
public void OnUpdate(ref SystemState state)
{
foreach (var (transform, dec) in
SystemAPI.Query<RefRW<LocalToWorld>, RefRO<DecorationVisualComponentData>>())
{
if (dec.ValueRO.loaded && dec.ValueRO.shouldRender)
{
Graphics.DrawMesh(dec.ValueRO.mesh.Result, transform.ValueRO.Value, dec.ValueRO.material.Result, 0);
}
}
}
}
}