Skip to content

Commit 0ed9c72

Browse files
[UI] Fix CanvasSystem NPE;
1 parent f4cfbfe commit 0ed9c72

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Engine/Core/UI/UICanvasSystem.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using Bgfx;
22
using System;
3-
using System.Collections.Generic;
43
using System.Linq;
54
using System.Numerics;
65
using Staple.UI;
@@ -14,7 +13,7 @@ public class UICanvasSystem : IRenderSystem
1413
{
1514
public const ushort UIViewID = 200;
1615

17-
private class RenderInfo
16+
private struct RenderInfo
1817
{
1918
public UICanvas canvas;
2019
public Transform canvasTransform;
@@ -54,8 +53,7 @@ public void Process((Entity, Transform, IComponent)[] entities, Camera activeCam
5453

5554
foreach (var (_, transform, relatedComponent) in entities)
5655
{
57-
if (relatedComponent is not UICanvas canvas ||
58-
renders.Any(x => x.canvas == canvas))
56+
if (relatedComponent is not UICanvas canvas)
5957
{
6058
continue;
6159
}

0 commit comments

Comments
 (0)