mirror of
https://github.com/hanzoai/ProjectTinySamples.git
synced 2026-09-24 00:01:34 +00:00
26 lines
646 B
C#
26 lines
646 B
C#
using Unity.Entities;
|
|
using Unity.Transforms;
|
|
|
|
|
|
namespace BlendShapeDemo
|
|
{
|
|
/// <summary>
|
|
/// Show panel according to game state
|
|
/// </summary>
|
|
|
|
[UpdateAfter(typeof(TransformSystemGroup))]
|
|
public class ShowPanelSystem : SystemBase
|
|
{
|
|
protected override void OnUpdate()
|
|
{
|
|
var game = GetSingleton<Game>();
|
|
|
|
Entities.WithEntityQueryOptions(EntityQueryOptions.IncludeDisabled).ForEach((Entity entity, ref Panel panel) =>
|
|
{
|
|
EntityManager.SetEnabled(entity, panel.gameState == game.gameState);
|
|
|
|
}).WithStructuralChanges().Run();
|
|
}
|
|
}
|
|
}
|