This commit is contained in:
CortexCore
2024-04-06 16:33:32 +08:00
parent 637bbef7d2
commit 37e7fcea51
42 changed files with 597 additions and 149 deletions

View File

@@ -0,0 +1,23 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
namespace BITKit.UX
{
public class TranslucentVisualElement : VisualElement
{
public new class UxmlFactory : UxmlFactory<TranslucentVisualElement, UxmlTraits> { }
public TranslucentVisualElement()
{
RegisterCallback<GeometryChangedEvent>(OnGeometryChanged);
}
private void OnGeometryChanged(GeometryChangedEvent evt)
{
if (style.display.value is not DisplayStyle.Flex) return;
style.backgroundImage = new StyleBackground(Background.FromRenderTexture(TranslucentService.BlurredScreen));
}
}
}