This commit is contained in:
CortexCore
2024-05-31 01:23:15 +08:00
parent c798b224be
commit 299082fe27
164 changed files with 3604 additions and 2018 deletions

View File

@@ -12,12 +12,23 @@ namespace BITKit.UX
public TranslucentVisualElement()
{
RegisterCallback<GeometryChangedEvent>(OnGeometryChanged);
generateVisualContent += DrawCanvas;
}
private void DrawCanvas(MeshGenerationContext obj)
{
}
private void OnGeometryChanged(GeometryChangedEvent evt)
{
#if UNITY_EDITOR
if (BITAppForUnity.IsPlaying is false) return;
#endif
if (style.display.value is not DisplayStyle.Flex) return;
style.backgroundImage = new StyleBackground(Background.FromRenderTexture(TranslucentService.BlurredScreen));
}
}
}