1
This commit is contained in:
@@ -11,6 +11,11 @@ namespace BITKit.UX
|
||||
public static RenderTexture BlurredScreen;
|
||||
[SerializeField] private TranslucentImageSource source;
|
||||
[SerializeField] private RenderTexture blurredScreen;
|
||||
private void LateUpdate()
|
||||
{
|
||||
source.Request();
|
||||
BlurredScreen = blurredScreen = source.BlurredScreen;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -2,7 +2,6 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.iOS;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace BITKit.UX
|
||||
@@ -25,12 +24,13 @@ namespace BITKit.UX
|
||||
image.enabled = obj;
|
||||
if (obj) alpha = 0;
|
||||
}
|
||||
private void Update()
|
||||
private void LateUpdate()
|
||||
{
|
||||
if (BITAppForUnity.AllowCursor.Allow && alpha is not 1)
|
||||
{
|
||||
alpha = Mathf.Clamp01(alpha + Time.deltaTime*5);
|
||||
image.color = new Color(0, 0, 0, alpha);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user