阶段性完成

This commit is contained in:
SoulliesOfficial
2025-12-08 05:27:53 -05:00
parent ef7b479712
commit f7af60351b
8770 changed files with 15637030 additions and 208354 deletions

View File

@@ -0,0 +1,5 @@
// Copyright (c) Le Loc Tai <leloctai.com> . All rights reserved. Do not redistribute.
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("LeTai.Asset.TranslucentImage.Editor.Paraform")]

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 6d493deb8f174b23b6f7db38e3082aea
timeCreated: 1751021755
AssetOrigin:
serializedVersion: 1
productId: 78464
packageName: Translucent Image - Fast UI Background Blur
packageVersion: 6.5.0
assetPath: Assets/Le Tai's Asset/TranslucentImage/Script/Editor/AssemblyInfo.cs
uploadId: 824068

View File

@@ -0,0 +1,27 @@
{
"name": "LeTai.Asset.TranslucentImage.Editor",
"rootNamespace": "LeTai.Asset.TranslucentImage.Editor",
"references": [
"GUID:6329229812871a6488deb623f659955b",
"GUID:ff218ee40fe2b8648ab3234d56415557",
"GUID:f063c9eabb2dec74ca53a0523cc14584",
"GUID:dbd67092ee33ae344825e5cf39a350f3"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [
{
"name": "com.unity.render-pipelines.universal",
"expression": "12",
"define": "URP12_OR_NEWER"
}
],
"noEngineReferences": false
}

View File

@@ -0,0 +1,14 @@
fileFormatVersion: 2
guid: 4cd721a6e0b119447afc3819b9015b13
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 78464
packageName: Translucent Image - Fast UI Background Blur
packageVersion: 6.5.0
assetPath: Assets/Le Tai's Asset/TranslucentImage/Script/Editor/LeTai.Asset.TranslucentImage.Editor.asmdef
uploadId: 824068

View File

@@ -0,0 +1,39 @@
// Copyright (c) Le Loc Tai <leloctai.com> . All rights reserved. Do not redistribute.
using System;
using UnityEditor;
using UnityEngine;
namespace LeTai.Asset.TranslucentImage.Editor
{
public static class MaterialEditorGUI
{
internal static float Slider(string label, float value, float left, float right)
{
var labelWidth = EditorGUIUtility.labelWidth;
EditorGUIUtility.labelWidth = 0;
var newValue = EditorGUILayout.Slider(label, value, left, right);
EditorGUIUtility.labelWidth = labelWidth;
return newValue;
}
public class PropertyScope : GUI.Scope
{
public bool Changed => _changeScope.changed;
private readonly EditorGUI.ChangeCheckScope _changeScope;
public PropertyScope(MaterialProperty prop)
{
_changeScope = new EditorGUI.ChangeCheckScope();
EditorGUI.showMixedValue = prop.hasMixedValue;
}
protected override void CloseScope()
{
EditorGUI.showMixedValue = false;
_changeScope.Dispose();
}
}
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: e036d3c54ac14463b116012c8f2119d7
timeCreated: 1750924605
AssetOrigin:
serializedVersion: 1
productId: 78464
packageName: Translucent Image - Fast UI Background Blur
packageVersion: 6.5.0
assetPath: Assets/Le Tai's Asset/TranslucentImage/Script/Editor/MaterialEditorGUI.cs
uploadId: 824068

View File

@@ -0,0 +1,176 @@
using UnityEditor;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
namespace LeTai.Asset.TranslucentImage.Editor
{
public class MenuIntegration : MonoBehaviour
{
[MenuItem("GameObject/UI/Translucent Image", false, 3)]
static void CreateTranslucentImage(MenuCommand menuCommand)
{
// Create a custom game object
GameObject go = new GameObject("Translucent Image");
go.AddComponent<TranslucentImage>();
PlaceUIElementRoot(go, menuCommand);
go.GetComponent<RectTransform>().sizeDelta = new Vector2(200, 200);
}
[MenuItem("CONTEXT/Image/Convert to Translucent Image", false, 3)]
static void ConvertToTranslucentImage(MenuCommand menuCommand)
{
var image = (Image) menuCommand.context;
var go = image.gameObject;
Undo.DestroyObjectImmediate(image);
var ti = Undo.AddComponent<TranslucentImage>(go);
ti.sprite = image.sprite;
var color = image.color;
ti.color = new Color(color.r, color.g, color.b,
1); // foreground opacity should be used instead of alpha most of the time
ti.raycastTarget = image.raycastTarget;
ti.type = image.type;
ti.useSpriteMesh = image.useSpriteMesh;
ti.preserveAspect = image.preserveAspect;
ti.fillCenter = image.fillCenter;
ti.fillMethod = image.fillMethod;
ti.fillOrigin = image.fillOrigin;
ti.fillAmount = image.fillAmount;
ti.fillClockwise = image.fillClockwise;
}
#region PlaceUIElementRoot
static void PlaceUIElementRoot(GameObject element, MenuCommand menuCommand)
{
GameObject parent = menuCommand.context as GameObject;
if (parent == null || parent.GetComponentInParent<Canvas>() == null)
{
parent = GetOrCreateCanvasGameObject();
}
string uniqueName = GameObjectUtility.GetUniqueNameForSibling(parent.transform, element.name);
element.name = uniqueName;
Undo.RegisterCreatedObjectUndo(element, "Create " + element.name);
Undo.SetTransformParent(element.transform, parent.transform, "Parent " + element.name);
GameObjectUtility.SetParentAndAlign(element, parent);
if (parent != menuCommand.context) // not a context click, so center in sceneview
SetPositionVisibleinSceneView(
parent.GetComponent<RectTransform>(),
element.GetComponent<RectTransform>());
Selection.activeGameObject = element;
}
// Helper function that returns a Canvas GameObject; preferably a parent of the selection, or other existing Canvas.
public static GameObject GetOrCreateCanvasGameObject()
{
GameObject selectedGo = Selection.activeGameObject;
// Try to find a gameobject that is the selected GO or one if its parents.
Canvas canvas = (selectedGo != null) ? selectedGo.GetComponentInParent<Canvas>() : null;
if (canvas != null && canvas.gameObject.activeInHierarchy)
return canvas.gameObject;
// No canvas in selection or its parents? Then use just any canvas..
canvas = Shims.FindObjectOfType<Canvas>();
if (canvas != null && canvas.gameObject.activeInHierarchy)
return canvas.gameObject;
// No canvas in the scene at all? Then create a new one.
return CreateNewUI();
}
public static GameObject CreateNewUI()
{
// Root for the UI
var root = new GameObject("Canvas") {layer = LayerMask.NameToLayer("UI")};
Canvas canvas = root.AddComponent<Canvas>();
canvas.renderMode = RenderMode.ScreenSpaceOverlay;
root.AddComponent<CanvasScaler>();
root.AddComponent<GraphicRaycaster>();
Undo.RegisterCreatedObjectUndo(root, "Create " + root.name);
// if there is no event system add one...
CreateEventSystem(false);
return root;
}
static void CreateEventSystem(bool select, GameObject parent = null)
{
var esys = Shims.FindObjectOfType<EventSystem>();
if (esys == null)
{
var eventSystem = new GameObject("EventSystem");
GameObjectUtility.SetParentAndAlign(eventSystem, parent);
esys = eventSystem.AddComponent<EventSystem>();
eventSystem.AddComponent<StandaloneInputModule>();
Undo.RegisterCreatedObjectUndo(eventSystem, "Create " + eventSystem.name);
}
if (select && esys != null)
{
Selection.activeGameObject = esys.gameObject;
}
}
static void SetPositionVisibleinSceneView(RectTransform canvasRTransform, RectTransform itemTransform)
{
// Find the best scene view
SceneView sceneView = SceneView.lastActiveSceneView;
if (sceneView == null && SceneView.sceneViews.Count > 0)
sceneView = SceneView.sceneViews[0] as SceneView;
// Couldn't find a SceneView. Don't set position.
if (sceneView == null || sceneView.camera == null)
return;
// Create world space Plane from canvas position.
Vector2 localPlanePosition;
Camera camera = sceneView.camera;
Vector3 position = Vector3.zero;
if (RectTransformUtility.ScreenPointToLocalPointInRectangle(
canvasRTransform,
new Vector2(camera.pixelWidth / 2, camera.pixelHeight / 2),
camera,
out localPlanePosition))
{
// Adjust for canvas pivot
localPlanePosition.x = localPlanePosition.x + canvasRTransform.sizeDelta.x * canvasRTransform.pivot.x;
localPlanePosition.y = localPlanePosition.y + canvasRTransform.sizeDelta.y * canvasRTransform.pivot.y;
localPlanePosition.x = Mathf.Clamp(localPlanePosition.x, 0, canvasRTransform.sizeDelta.x);
localPlanePosition.y = Mathf.Clamp(localPlanePosition.y, 0, canvasRTransform.sizeDelta.y);
// Adjust for anchoring
position.x = localPlanePosition.x - canvasRTransform.sizeDelta.x * itemTransform.anchorMin.x;
position.y = localPlanePosition.y - canvasRTransform.sizeDelta.y * itemTransform.anchorMin.y;
Vector3 minLocalPosition;
minLocalPosition.x = canvasRTransform.sizeDelta.x * (0 - canvasRTransform.pivot.x) +
itemTransform.sizeDelta.x * itemTransform.pivot.x;
minLocalPosition.y = canvasRTransform.sizeDelta.y * (0 - canvasRTransform.pivot.y) +
itemTransform.sizeDelta.y * itemTransform.pivot.y;
Vector3 maxLocalPosition;
maxLocalPosition.x = canvasRTransform.sizeDelta.x * (1 - canvasRTransform.pivot.x) -
itemTransform.sizeDelta.x * itemTransform.pivot.x;
maxLocalPosition.y = canvasRTransform.sizeDelta.y * (1 - canvasRTransform.pivot.y) -
itemTransform.sizeDelta.y * itemTransform.pivot.y;
position.x = Mathf.Clamp(position.x, minLocalPosition.x, maxLocalPosition.x);
position.y = Mathf.Clamp(position.y, minLocalPosition.y, maxLocalPosition.y);
}
itemTransform.anchoredPosition = position;
itemTransform.localRotation = Quaternion.identity;
itemTransform.localScale = Vector3.one;
}
#endregion
}
}

View File

@@ -0,0 +1,19 @@
fileFormatVersion: 2
guid: 99feb6419b119464aa5a3ad6549ea73c
timeCreated: 1539852386
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 78464
packageName: Translucent Image - Fast UI Background Blur
packageVersion: 6.5.0
assetPath: Assets/Le Tai's Asset/TranslucentImage/Script/Editor/MenuIntegration.cs
uploadId: 824068

View File

@@ -0,0 +1,79 @@
using System.Diagnostics.CodeAnalysis;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;
namespace LeTai.Asset.TranslucentImage.Editor
{
public static class Migration
{
[MenuItem("Tools/Translucent Image/Migrate to 6.0", false, 10000)]
[SuppressMessage("ReSharper", "Unity.PreferAddressByIdToGraphicsParams")]
static void MigrateTo60()
{
var tiArr = Shims.FindObjectsOfType<TranslucentImage>();
foreach (var ti in tiArr)
{
Undo.RecordObject(ti, "Migrate to 6.0");
var mat = ti.material;
var matSo = new SerializedObject(mat);
// var shader = mat.shader;
// mat.SetKeyword(new LocalKeyword(shader, "_BACKGROUND_MODE_NORMAL"), mat.IsKeywordEnabled("_FOREGROUND_MODE_CONSISTENT"));
// mat.SetKeyword(new LocalKeyword(shader, "_BACKGROUND_MODE_COLORFUL"), mat.IsKeywordEnabled("_FOREGROUND_MODE_COLORFUL"));
// if (shader.name == "UI/TranslucentImage-Paraform")
// mat.SetKeyword(new LocalKeyword(shader, "_BACKGROUND_MODE_OPAQUE"), mat.IsKeywordEnabled("_FOREGROUND_MODE_ONLY"));
// mat.SetFloat("_BACKGROUND_MODE", (int)mat.GetFloat("_FOREGROUND_MODE"));
var savedProps = matSo.FindProperty("m_SavedProperties");
if (TryFindOrphanMaterialProperty(savedProps, "_Vibrancy", out float vibrancy))
ti.vibrancy = vibrancy;
if (TryFindOrphanMaterialProperty(savedProps, "_Brightness", out float brightness))
ti.brightness = brightness;
if (TryFindOrphanMaterialProperty(savedProps, "_Flatten", out float flatten))
ti.flatten = flatten;
if (TryFindOrphanMaterialProperty(savedProps, "_ForegroundOpacity", out float foregroundOpacity))
ti.foregroundOpacity = foregroundOpacity;
EditorUtility.SetDirty(mat);
EditorUtility.SetDirty(ti);
Debug.Log("Migrated " + ti.name);
}
var scene = SceneManager.GetActiveScene();
EditorSceneManager.MarkSceneDirty(scene);
Debug.Log("Migrated scene " + scene.name);
}
static bool TryFindOrphanMaterialProperty<T>(SerializedProperty savedProps, string propertyName, out T value)
{
value = default;
var arrayName = typeof(T) == typeof(float) ? "m_Floats"
: typeof(T) == typeof(Color) ? "m_Colors"
: typeof(T) == typeof(Texture) ? "m_Texs"
: null;
if (arrayName == null) return false;
var array = savedProps.FindPropertyRelative(arrayName);
for (var i = 0; i < array.arraySize; i++)
{
var matProp = array.GetArrayElementAtIndex(i);
if (matProp.FindPropertyRelative("first").stringValue == propertyName)
{
var valProp = matProp.FindPropertyRelative("second");
value = typeof(T) == typeof(float) ? (T)(object)valProp.floatValue
: typeof(T) == typeof(Color) ? (T)(object)valProp.colorValue
: (T)(object)valProp.objectReferenceValue;
return true;
}
}
return false;
}
}
}

View File

@@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: 69cb9068e80c2e44db80afedac9e414c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 78464
packageName: Translucent Image - Fast UI Background Blur
packageVersion: 6.5.0
assetPath: Assets/Le Tai's Asset/TranslucentImage/Script/Editor/Migration.cs
uploadId: 824068

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ace044fc6a6bf3649a39e77c7a77f6c6
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,114 @@
fileFormatVersion: 2
guid: c2fc80b7e20a4104db1297bcddfd83b5
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 78464
packageName: Translucent Image - Fast UI Background Blur
packageVersion: 6.5.0
assetPath: Assets/Le Tai's Asset/TranslucentImage/Script/Editor/Resources/BlurConfig
Icon.png
uploadId: 824068

View File

@@ -0,0 +1,114 @@
fileFormatVersion: 2
guid: 4bc9a290ca74e434499699e3db41c3f9
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 78464
packageName: Translucent Image - Fast UI Background Blur
packageVersion: 6.5.0
assetPath: Assets/Le Tai's Asset/TranslucentImage/Script/Editor/Resources/BlurSource
Icon.png
uploadId: 824068

View File

@@ -0,0 +1,142 @@
fileFormatVersion: 2
guid: 1cd4d3c69546e04408d9b94e5b4b11ab
labels:
- TranslucentImageEditorResources
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 78464
packageName: Translucent Image - Fast UI Background Blur
packageVersion: 6.5.0
assetPath: Assets/Le Tai's Asset/TranslucentImage/Script/Editor/Resources/Knob_BG.png
uploadId: 824068

View File

@@ -0,0 +1,142 @@
fileFormatVersion: 2
guid: fdf18819c7c4cfd48b44182ec0a87e15
labels:
- TranslucentImageEditorResources
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 78464
packageName: Translucent Image - Fast UI Background Blur
packageVersion: 6.5.0
assetPath: Assets/Le Tai's Asset/TranslucentImage/Script/Editor/Resources/Knob_FG.png
uploadId: 824068

View File

@@ -0,0 +1,114 @@
fileFormatVersion: 2
guid: 0764cd30e065b7340891d9f7f680a12f
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 4
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -1
wrapU: -1
wrapV: -1
wrapW: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 78464
packageName: Translucent Image - Fast UI Background Blur
packageVersion: 6.5.0
assetPath: Assets/Le Tai's Asset/TranslucentImage/Script/Editor/Resources/TranslucentImage
Icon.png
uploadId: 824068

View File

@@ -0,0 +1,142 @@
fileFormatVersion: 2
guid: a00d4db4afc81cb48bd1f0deb7c6aba7
labels:
- TranslucentImageEditorResources
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 1
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 1
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 78464
packageName: Translucent Image - Fast UI Background Blur
packageVersion: 6.5.0
assetPath: Assets/Le Tai's Asset/TranslucentImage/Script/Editor/Resources/round_corner_bl.png
uploadId: 824068

View File

@@ -0,0 +1,142 @@
fileFormatVersion: 2
guid: e984439ef57f3a64399fa255d7c4ba16
labels:
- TranslucentImageEditorResources
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 1
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 1
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 78464
packageName: Translucent Image - Fast UI Background Blur
packageVersion: 6.5.0
assetPath: Assets/Le Tai's Asset/TranslucentImage/Script/Editor/Resources/round_corner_br.png
uploadId: 824068

View File

@@ -0,0 +1,142 @@
fileFormatVersion: 2
guid: 0bdf2adb70adf36449bbc431fc921bbc
labels:
- TranslucentImageEditorResources
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 1
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 1
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 78464
packageName: Translucent Image - Fast UI Background Blur
packageVersion: 6.5.0
assetPath: Assets/Le Tai's Asset/TranslucentImage/Script/Editor/Resources/round_corner_tl.png
uploadId: 824068

View File

@@ -0,0 +1,142 @@
fileFormatVersion: 2
guid: 28ffad455fa2c244c85c5d788e285cfc
labels:
- TranslucentImageEditorResources
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 1
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 1
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 78464
packageName: Translucent Image - Fast UI Background Blur
packageVersion: 6.5.0
assetPath: Assets/Le Tai's Asset/TranslucentImage/Script/Editor/Resources/round_corner_tr.png
uploadId: 824068

View File

@@ -0,0 +1,143 @@
using System;
using LeTai.Common.Editor;
using UnityEditor;
using UnityEditor.AnimatedValues;
using UnityEngine;
namespace LeTai.Asset.TranslucentImage.Editor
{
[CustomEditor(typeof(ScalableBlurConfig))]
[CanEditMultipleObjects]
public class ScalableBlurConfigEditor : UnityEditor.Editor
{
static readonly EditorPrefValue<bool> SHOW_RESOLUTION_MATCHING = new("TranslucentImage_ShowResolutionMatching", false);
readonly AnimBool useAdvancedControl = new AnimBool(false);
int tab, previousTab;
EditorProperty radius;
EditorProperty iteration;
EditorProperty strength;
EditorProperty mode;
EditorProperty referenceResolution;
EditorProperty matchWidthOrHeight;
SerializedProperty useStrength;
public void Awake()
{
LoadTabSelection();
useAdvancedControl.value = tab > 0;
}
public void OnEnable()
{
radius = new EditorProperty(serializedObject, nameof(ScalableBlurConfig.Radius));
iteration = new EditorProperty(serializedObject, nameof(ScalableBlurConfig.Iteration));
strength = new EditorProperty(serializedObject, nameof(ScalableBlurConfig.Strength));
mode = new EditorProperty(serializedObject, nameof(ScalableBlurConfig.Mode));
referenceResolution = new EditorProperty(serializedObject, nameof(ScalableBlurConfig.ReferenceResolution));
matchWidthOrHeight = new EditorProperty(serializedObject, nameof(ScalableBlurConfig.MatchWidthOrHeight));
useStrength = serializedObject.FindProperty("useStrength");
// Without this the editor will not Repaint automatically when animating
useAdvancedControl.valueChanged.AddListener(Repaint);
}
public override void OnInspectorGUI()
{
Draw();
}
public void Draw()
{
using var changes = new EditorGUI.ChangeCheckScope();
using var _ = new EditorGUILayout.VerticalScope();
mode.Draw();
EditorGUILayout.Space();
DrawTabBar();
serializedObject.Update();
DrawTabsContent();
EditorGUILayout.Space();
SHOW_RESOLUTION_MATCHING.Value = EditorGUILayout.BeginFoldoutHeaderGroup(SHOW_RESOLUTION_MATCHING,
"Resolution matching",
EditorStyles.foldout);
if (SHOW_RESOLUTION_MATCHING)
{
referenceResolution.Draw();
matchWidthOrHeight.Draw();
}
EditorGUILayout.EndFoldoutHeaderGroup();
if (changes.changed)
serializedObject.ApplyModifiedProperties();
}
void DrawTabBar()
{
using (var h = new EditorGUILayout.HorizontalScope())
{
GUILayout.FlexibleSpace();
tab = GUILayout.Toolbar(
tab,
new[] { "Simple", "Advanced" },
GUILayout.MinWidth(0),
GUILayout.MaxWidth(EditorGUIUtility.pixelsPerPoint * 192)
);
GUILayout.FlexibleSpace();
}
if (tab != previousTab)
{
GUI.FocusControl(""); // Defocus
SaveTabSelection();
previousTab = tab;
}
useAdvancedControl.target = tab == 1;
}
void DrawTabsContent()
{
if (EditorGUILayout.BeginFadeGroup(1 - useAdvancedControl.faded))
{
// EditorProperty dooesn't invoke getter. Not needed anywhere else.
_ = ((ScalableBlurConfig)target).Strength;
using var changes = new EditorGUI.ChangeCheckScope();
strength.Draw();
if (changes.changed)
useStrength.boolValue = true;
}
EditorGUILayout.EndFadeGroup();
if (EditorGUILayout.BeginFadeGroup(useAdvancedControl.faded))
{
using var changes = new EditorGUI.ChangeCheckScope();
radius.Draw();
iteration.Draw();
if (changes.changed)
useStrength.boolValue = false;
}
EditorGUILayout.EndFadeGroup();
}
//Persist selected tab between sessions and instances
void SaveTabSelection()
{
EditorPrefs.SetInt("LETAI_TRANSLUCENTIMAGE_TIS_TAB", tab);
}
void LoadTabSelection()
{
if (EditorPrefs.HasKey("LETAI_TRANSLUCENTIMAGE_TIS_TAB"))
tab = EditorPrefs.GetInt("LETAI_TRANSLUCENTIMAGE_TIS_TAB");
}
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 771a13bc1eb042bc9d4ad186dd99dda5
timeCreated: 1560160054
AssetOrigin:
serializedVersion: 1
productId: 78464
packageName: Translucent Image - Fast UI Background Blur
packageVersion: 6.5.0
assetPath: Assets/Le Tai's Asset/TranslucentImage/Script/Editor/ScalableBlurConfigEditor.cs
uploadId: 824068

View File

@@ -0,0 +1,55 @@
using System;
using System.Linq;
using System.Reflection;
using UnityEditor;
namespace LeTai.Asset.TranslucentImage.Editor
{
class ScenceGizmoAutoDisable : AssetPostprocessor
{
static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
{
if (!importedAssets.Any(p => p.Contains("TranslucentImage")))
return;
var structAnnotation = Type.GetType("UnityEditor.Annotation, UnityEditor");
if (structAnnotation == null) return;
var fieldClassId = structAnnotation.GetField("classID");
var fieldScriptClass = structAnnotation.GetField("scriptClass");
var fieldFlags = structAnnotation.GetField("flags");
var fieldIconEnabled = structAnnotation.GetField("iconEnabled");
Type classAnnotationUtility = Type.GetType("UnityEditor.AnnotationUtility, UnityEditor");
if (classAnnotationUtility == null) return;
var methodGetAnnotations = classAnnotationUtility.GetMethod("GetAnnotations", BindingFlags.NonPublic | BindingFlags.Static);
if (methodGetAnnotations == null) return;
var methodSetIconEnabled = classAnnotationUtility.GetMethod("SetIconEnabled", BindingFlags.NonPublic | BindingFlags.Static);
if (methodSetIconEnabled == null) return;
Array annotations = (Array)methodGetAnnotations.Invoke(null, null);
foreach (var a in annotations)
{
string scriptClass = (string)fieldScriptClass.GetValue(a);
// built in types
if (string.IsNullOrEmpty(scriptClass)) continue;
int classId = (int)fieldClassId.GetValue(a);
int flags = (int)fieldFlags.GetValue(a);
int iconEnabled = (int)fieldIconEnabled.GetValue(a);
const int maskHasIcon = 1;
bool hasIconFlag = (flags & maskHasIcon) == maskHasIcon;
if (hasIconFlag
&& iconEnabled != 0
&& scriptClass.Contains("TranslucentImage"))
{
methodSetIconEnabled.Invoke(null, new object[] { classId, scriptClass, 0 });
}
}
}
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: d3c5df780c45454e820502d48a07db97
timeCreated: 1575814101
AssetOrigin:
serializedVersion: 1
productId: 78464
packageName: Translucent Image - Fast UI Background Blur
packageVersion: 6.5.0
assetPath: Assets/Le Tai's Asset/TranslucentImage/Script/Editor/ScenceGizmoAutoDisable.cs
uploadId: 824068

View File

@@ -0,0 +1,427 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;
using LeTai.Common.Editor;
using LeTai.Paraform.Scaffold.Editor;
using UnityEditor;
using UnityEditor.AnimatedValues;
using UnityEditor.UI;
using UnityEngine;
using Debug = System.Diagnostics.Debug;
using Image = UnityEngine.UI.Image;
using Object = UnityEngine.Object;
#pragma warning disable CS0162 // Unreachable code detected
namespace LeTai.Asset.TranslucentImage.Editor
{
[CustomEditor(typeof(TranslucentImage))]
[CanEditMultipleObjects]
public class TranslucentImageEditor : ImageEditor
{
SerializedProperty type;
SerializedProperty sprite;
SerializedProperty preserveAspect;
SerializedProperty useSpriteMesh;
EditorProperty source;
EditorProperty foregroundOpacity;
EditorProperty _vibrancy;
EditorProperty _brightness;
EditorProperty _flatten;
GUIStyle styleBtnSource;
static readonly EditorPrefValue<bool> SHOW_PARAFORM_SHAPE_CONTROLS = new("TranslucentImage_ShowParaformShapeControls", HAVE_PARAFORM);
static readonly EditorPrefValue<bool> SHOW_MATERIAL_PROPERTIES = new("TranslucentImage_ShowMaterialProperties", true);
AnimBool showTypeAnim;
List<TranslucentImage> tiList;
UnityEditor.Editor materialEditor;
ParaformEditor paraformEditor;
bool needValidateSource;
bool needValidateMaterial;
bool materialUsedInDifferentSource;
bool usingIncorrectShader;
int smallFontSize;
const bool HAVE_PARAFORM =
#if LETAI_PARAFORM
true;
#else
false;
#endif
protected override void OnEnable()
{
base.OnEnable();
typeof(ImageEditor).GetField("m_SpriteContent", BindingFlags.Instance | BindingFlags.NonPublic)
.SetValue(this, new GUIContent("Sprite"));
sprite = serializedObject.FindProperty("m_Sprite");
type = serializedObject.FindProperty("m_Type");
preserveAspect = serializedObject.FindProperty("m_PreserveAspect");
useSpriteMesh = serializedObject.FindProperty("m_UseSpriteMesh");
source = new EditorProperty(serializedObject, nameof(TranslucentImage.source), "_source");
foregroundOpacity = new EditorProperty(serializedObject, nameof(TranslucentImage.foregroundOpacity));
_vibrancy = new EditorProperty(serializedObject, nameof(TranslucentImage.vibrancy));
_brightness = new EditorProperty(serializedObject, nameof(TranslucentImage.brightness));
_flatten = new EditorProperty(serializedObject, nameof(TranslucentImage.flatten));
paraformEditor = new ParaformEditor(serializedObject.FindProperty("paraformConfig"));
showTypeAnim = new AnimBool(sprite.objectReferenceValue);
showTypeAnim.valueChanged.AddListener(Repaint);
tiList = targets.Cast<TranslucentImage>().ToList();
if (tiList.Count > 0)
{
CheckMaterialUsedInDifferentSource();
CheckCorrectShader();
}
}
void InitStyle()
{
if (styleBtnSource != null)
return;
styleBtnSource = new GUIStyle(GUI.skin.button) {
alignment = TextAnchor.MiddleLeft,
richText = true,
};
smallFontSize = Mathf.RoundToInt(styleBtnSource.fontSize * .8f);
}
public override void OnInspectorGUI()
{
InitStyle();
serializedObject.Update();
tiList = targets.Cast<TranslucentImage>().ToList();
Debug.Assert(tiList.Count > 0, "Translucent Image Editor serializedObject target is null");
DrawSourceControls();
DrawShapeControls();
EditorGUILayout.Space();
EditorGUILayout.LabelField("Appearance", EditorStyles.boldLabel);
DrawSpriteControls();
EditorGUILayout.PropertyField(m_Color);
foregroundOpacity.Draw();
_vibrancy.Draw();
_brightness.Draw();
_flatten.Draw();
EditorGUILayout.Space();
DrawMaterialControls();
DrawMaterialProperties();
EditorGUILayout.Space();
EditorGUILayout.LabelField("Interaction", EditorStyles.boldLabel);
RaycastControlsGUI();
MaskableControlsGUI();
serializedObject.ApplyModifiedProperties();
if (needValidateSource) ValidateSource();
if (needValidateMaterial) ValidateMaterial();
}
void DrawSourceControls()
{
using (var changes = new EditorGUI.ChangeCheckScope())
{
source.Draw();
if (changes.changed)
needValidateSource = true;
}
if (!source.serializedProperty.objectReferenceValue)
{
var existingSources = Shims.FindObjectsOfType<TranslucentImageSource>();
if (existingSources.Length > 0)
{
using (new EditorGUI.IndentLevelScope())
{
using var h = new EditorGUILayout.HorizontalScope();
EditorGUILayout.PrefixLabel("From current Scene");
using var v = new EditorGUILayout.VerticalScope();
foreach (var s in existingSources)
{
SetSourceBtn($"{s.gameObject.name}\t{GetSourceDescriptionLabel(s)}", s);
}
}
EditorGUILayout.Space();
}
else
{
EditorGUILayout.HelpBox("No Translucent Image Source(s) found in current scene", MessageType.Warning);
}
}
else
{
using var _ = new EditorGUI.IndentLevelScope(1);
var sourceObj = (TranslucentImageSource)source.serializedProperty.objectReferenceValue;
var config = sourceObj.BlurConfig;
if (config)
{
var oldStrength = config.Strength;
var newStrength = EditorGUILayout.FloatField("Blur Strength", oldStrength);
if (!Mathf.Approximately(newStrength, oldStrength))
{
Undo.RecordObject(config, "Change blur config");
config.Strength = newStrength;
EditorUtility.SetDirty(config);
}
}
else
{
using var h = new EditorGUILayout.HorizontalScope();
EditorGUILayout.LabelField(" ", "No Blur Config");
}
var sameCameraSources = sourceObj.GetComponents<TranslucentImageSource>();
if (sameCameraSources.Length > 1)
{
using var h = new EditorGUILayout.HorizontalScope();
EditorGUILayout.PrefixLabel("Other Sources");
foreach (var s in sameCameraSources)
{
if (s == sourceObj)
continue;
SetSourceBtn(GetSourceDescriptionLabel(s), s);
}
}
}
}
string GetSourceDescriptionLabel(TranslucentImageSource s)
{
if (s.BlurConfig)
return $"<size={smallFontSize}>STR: </size>{s.BlurConfig.Strength:0.#}";
return $"<size={smallFontSize}>No Blur Config</size>";
}
void SetSourceBtn(string label, TranslucentImageSource newSource)
{
if (GUILayout.Button(label, styleBtnSource, GUILayout.ExpandWidth(false)))
{
Undo.RecordObject(target, $"Set source to {newSource.gameObject.name}");
source.serializedProperty.objectReferenceValue = newSource;
source.CallSetters(newSource);
needValidateSource = true;
needValidateMaterial = true;
}
}
[SuppressMessage("ReSharper", "ConditionIsAlwaysTrueOrFalse")]
[SuppressMessage("ReSharper", "HeuristicUnreachableCode")]
void DrawShapeControls()
{
var useParaform = tiList.Any(ti => ti.material && ti.material.shader.name.EndsWith("-Paraform"));
using (new EditorGUILayout.HorizontalScope())
{
var label = "Paraform";
if (!HAVE_PARAFORM)
label += " (not installed)";
else if (!useParaform)
label += " (Not supported by material)";
SHOW_PARAFORM_SHAPE_CONTROLS.Value = EditorGUILayout.BeginFoldoutHeaderGroup(SHOW_PARAFORM_SHAPE_CONTROLS, label);
if (HAVE_PARAFORM && !useParaform)
{
if (GUILayout.Button("Use Paraform Shader"))
{
foreach (var ti in tiList)
{
var mat = ti.material;
Undo.RecordObject(mat, "Use Paraform Shader");
mat.shader = Shader.Find("UI/TranslucentImage-Paraform");
}
}
}
}
using var disabledGroupScope = new EditorGUI.DisabledGroupScope(!HAVE_PARAFORM || !useParaform);
if (SHOW_PARAFORM_SHAPE_CONTROLS)
{
using var changes = new EditorGUI.ChangeCheckScope();
paraformEditor?.DrawShapeControls();
if (changes.changed)
{
serializedObject.ApplyModifiedProperties();
foreach (var ti in tiList) ti.paraformConfig.NotifyChanged();
}
ParaformEditor.MaybeGetParaformLinkBtn();
}
EditorGUILayout.EndFoldoutHeaderGroup();
}
void DrawSpriteControls()
{
SpriteGUI();
showTypeAnim.target = sprite.objectReferenceValue != null;
if (EditorGUILayout.BeginFadeGroup(showTypeAnim.faded))
TypeGUI();
EditorGUILayout.EndFadeGroup();
Image.Type type = (Image.Type)this.type.enumValueIndex;
bool showNativeSize = (type == Image.Type.Simple || type == Image.Type.Filled)
&& sprite.objectReferenceValue != null;
SetShowNativeSize(showNativeSize, false);
if (EditorGUILayout.BeginFadeGroup(m_ShowNativeSize.faded))
{
EditorGUI.indentLevel++;
if ((Image.Type)this.type.enumValueIndex == Image.Type.Simple)
EditorGUILayout.PropertyField(useSpriteMesh);
EditorGUILayout.PropertyField(preserveAspect);
EditorGUI.indentLevel--;
}
EditorGUILayout.EndFadeGroup();
NativeSizeButtonGUI();
}
void DrawMaterialControls()
{
using var changes = new EditorGUI.ChangeCheckScope();
EditorGUILayout.PropertyField(m_Material);
if (changes.changed)
needValidateMaterial = true;
if (usingIncorrectShader)
{
EditorGUILayout.HelpBox("Material is using unsupported shader", MessageType.Warning);
}
if (materialUsedInDifferentSource)
{
EditorGUILayout.HelpBox("Translucent Images with different Sources" +
" should also use different Materials",
MessageType.Error);
}
}
void DrawMaterialProperties()
{
using var change = new EditorGUI.ChangeCheckScope();
var targetMaterials = tiList.Select(t => t.material).Cast<Object>().ToArray();
using (_ = new EditorGUI.IndentLevelScope())
{
SHOW_MATERIAL_PROPERTIES.Value = EditorGUILayout.BeginFoldoutHeaderGroup(SHOW_MATERIAL_PROPERTIES, "Material settings");
if (SHOW_MATERIAL_PROPERTIES)
{
bool prevGuiEnabled = GUI.enabled;
if (targetMaterials.Any(m => m.hideFlags == HideFlags.HideAndDontSave))
{
using (new EditorGUILayout.HorizontalScope())
{
EditorGUILayout.HelpBox("Create a new Material to edit", MessageType.Info);
if (GUILayout.Button("Create Material", GUILayout.ExpandHeight(true)))
{
var path = EditorUtility.SaveFilePanelInProject("Save New Material", "Translucent Image Material", "mat", "");
if (!string.IsNullOrEmpty(path))
{
var material = Instantiate(HAVE_PARAFORM
? DefaultResources.Instance.paraformMaterial
: DefaultResources.Instance.material);
m_Material.objectReferenceValue = material;
AssetDatabase.CreateAsset(material, path);
}
}
}
GUI.enabled = false;
}
CreateCachedEditor(targetMaterials, typeof(MaterialEditor), ref materialEditor);
var materialProperties = MaterialEditor.GetMaterialProperties(targetMaterials);
TranslucentImageShaderGUI.DrawProperties((MaterialEditor)materialEditor, materialProperties, true);
GUI.enabled = prevGuiEnabled;
}
EditorGUILayout.EndFoldoutHeaderGroup();
}
if (change.changed)
{
foreach (var ti in tiList)
{
if (ti.materialForRendering != ti.material)
{
Undo.RecordObject(ti.materialForRendering, $"Modify material {ti.material.name}");
TranslucentImage.CopyMaterialPropertiesTo(ti.material, ti.materialForRendering);
}
}
}
}
void ValidateSource()
{
CheckMaterialUsedInDifferentSource();
needValidateSource = false;
}
void ValidateMaterial()
{
CheckMaterialUsedInDifferentSource();
CheckCorrectShader();
needValidateMaterial = false;
}
private void CheckCorrectShader()
{
usingIncorrectShader = tiList.Any(ti => !ti.material.shader.name.Contains("TranslucentImage"));
}
private void CheckMaterialUsedInDifferentSource()
{
if (!tiList[0].source
|| tiList[0].material.IsKeywordEnabled(ShaderID.KW_BACKGROUND_MODE_OPAQUE))
{
materialUsedInDifferentSource = false;
return;
}
var diffSource = Shims.FindObjectsOfType<TranslucentImage>()
.Where(ti => ti.source != tiList[0].source)
.ToList();
if (!diffSource.Any())
{
materialUsedInDifferentSource = false;
return;
}
var sameMat = diffSource.GroupBy(ti => ti.material).ToList();
materialUsedInDifferentSource = sameMat.Any(group => group.Key == tiList[0].material);
needValidateMaterial = false;
}
}
}

View File

@@ -0,0 +1,19 @@
fileFormatVersion: 2
guid: 9a6952d1e37a4f0458848a0e61378de5
timeCreated: 1539852386
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 78464
packageName: Translucent Image - Fast UI Background Blur
packageVersion: 6.5.0
assetPath: Assets/Le Tai's Asset/TranslucentImage/Script/Editor/TranslucentImageEditor.cs
uploadId: 824068

View File

@@ -0,0 +1,244 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using LeTai.Common.Editor;
using LeTai.Paraform.Scaffold;
using LeTai.Paraform.Scaffold.Editor;
using UnityEditor;
using UnityEngine;
using EGU = UnityEditor.EditorGUIUtility;
namespace LeTai.Asset.TranslucentImage.Editor
{
public class TranslucentImageShaderGUI : ShaderGUI
{
static readonly EditorPrefValue<bool> SHOW_PARAFORM_MATERIAL_CONTROLS = new("TranslucentImage_ShowParaformMaterialControls", true);
public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] properties)
{
DrawProperties(materialEditor, properties, false);
}
[SuppressMessage("ReSharper", "ConditionIsAlwaysTrueOrFalse")]
public static void DrawProperties(MaterialEditor materialEditor, MaterialProperty[] properties, bool skipUnimportants)
{
float oldLabelWidth = EGU.labelWidth;
float oldFieldWidth = EGU.fieldWidth;
materialEditor.SetDefaultGUIWidths();
// ReSharper disable once ConvertToConstant.Local
bool haveParaform = false;
#if LETAI_PARAFORM
haveParaform = true;
#endif
var useParaform = ((Material)materialEditor.target).shader.name == "UI/TranslucentImage-Paraform";
using var propIter = properties.AsEnumerable().GetEnumerator();
var reflectionModeProp = DrawDefaultUntil("_REFRACTION_MODE");
EditorGUILayout.Space();
var paraformLabel = "Paraform";
if (!haveParaform)
paraformLabel += " (not installed)";
SHOW_PARAFORM_MATERIAL_CONTROLS.Value = EditorGUILayout.Foldout(
SHOW_PARAFORM_MATERIAL_CONTROLS, paraformLabel, true, EditorStyles.foldoutHeader);
if (!SHOW_PARAFORM_MATERIAL_CONTROLS)
{
while (propIter.Current.name != "_StencilComp")
propIter.MoveNext();
}
else
{
using (new EditorGUI.DisabledGroupScope(!haveParaform))
{
if (haveParaform && !useParaform)
EditorGUILayout.HelpBox("Change the material's shader to UI/TranslucentImage-Paraform to enable", MessageType.Info);
using (new EditorGUI.DisabledGroupScope(!useParaform))
{
var refractiveIndexProp = ConsumeProp();
var chromaticDispersionProp = ConsumeProp();
var refractiveIndexRatiosProp = ConsumeProp();
using (var changes = new EditorGUI.ChangeCheckScope())
{
DrawDefault(reflectionModeProp);
var refractionMode = (RefractionMode)(int)reflectionModeProp.floatValue;
using (new EditorGUI.DisabledScope(refractionMode == RefractionMode.Off))
DrawDefault(refractiveIndexProp);
using (new EditorGUI.DisabledScope(refractionMode != RefractionMode.Chromatic))
DrawDefault(chromaticDispersionProp);
if (changes.changed)
refractiveIndexRatiosProp.vectorValue = ParaformMaterial
.GetRefractiveIndexRatios(
refractiveIndexProp.floatValue,
refractionMode == RefractionMode.Chromatic ? chromaticDispersionProp.floatValue : 0
);
}
var useEdgeGlintProp = ConsumeProp();
DrawDefault(useEdgeGlintProp);
using (new EditorGUI.DisabledScope(useEdgeGlintProp.floatValue == 0))
{
var edgeGlintDirectionsProp = ConsumePropName("_EdgeGlintDirections");
DrawEdgeGlintDirections(edgeGlintDirectionsProp);
var edgeGlintWrapProp = DrawDefaultUntil("_EdgeGlintWrap");
DrawEdgeGlintWrap(edgeGlintWrapProp);
var edgeGlintSharpnessProp = ConsumePropName("_EdgeGlintSharpness");
DrawEdgeGlintSharpness(edgeGlintSharpnessProp);
}
}
if (!haveParaform)
ParaformEditor.MaybeGetParaformLinkBtn();
ConsumeProp();
}
}
if (!skipUnimportants)
{
do
{
DrawDefault(propIter.Current);
} while (propIter.MoveNext());
}
EditorGUILayout.Space();
if (!skipUnimportants)
{
EditorGUILayout.Space();
if (UnityEngine.Rendering.SupportedRenderingFeatures.active.editableMaterialRenderQueue)
materialEditor.RenderQueueField();
materialEditor.EnableInstancingField();
materialEditor.DoubleSidedGIField();
}
EGU.labelWidth = oldLabelWidth;
EGU.fieldWidth = oldFieldWidth;
return;
MaterialProperty ConsumeProp()
{
return propIter.MoveNext() ? propIter.Current : null;
}
MaterialProperty ConsumePropName(string name)
{
var next = ConsumeProp();
if (next.name != name)
throw new ArgumentException($"Expect {name} but got {next.name}");
return next;
}
MaterialProperty DrawDefaultUntil(string name)
{
while (propIter.MoveNext() && propIter.Current.name != name)
DrawDefault(propIter.Current);
return propIter.Current;
}
void DrawDefault(MaterialProperty prop)
{
if ((prop.propertyFlags & UnityEngine.Rendering.ShaderPropertyFlags.HideInInspector) != 0)
return;
if (skipUnimportants && (prop.propertyFlags & UnityEngine.Rendering.ShaderPropertyFlags.PerRendererData) != 0)
return;
float h = materialEditor.GetPropertyHeight(prop, prop.displayName);
Rect r = EditorGUILayout.GetControlRect(true, h);
materialEditor.ShaderProperty(r, prop, GetPropGUIContent(prop));
}
}
static void DrawEdgeGlintDirections(MaterialProperty prop)
{
Vector4 value = prop.vectorValue;
var angle1 = MathCustom.VecToAngle360(Vector2.right, new Vector2(value.x, -value.y));
var angle2 = MathCustom.VecToAngle360(Vector2.right, new Vector2(value.z, -value.w));
EditorGUI.showMixedValue = prop.hasMixedValue;
using var changeScope = new EditorGUI.ChangeCheckScope();
LABEL.text = "Edge Glint 1 Direction";
angle1 = EditorGUICustom.KnobField(LABEL, angle1, Vector2.right);
LABEL.text = "Edge Glint 2 Direction";
angle2 = EditorGUICustom.KnobField(LABEL, angle2, Vector2.right);
EditorGUI.showMixedValue = false;
if (changeScope.changed)
{
var dir1 = MathCustom.Angle360ToVec(angle1, Vector2.right);
var dir2 = MathCustom.Angle360ToVec(angle2, Vector2.right);
prop.vectorValue = new Vector4(dir1.x, -dir1.y, dir2.x, -dir2.y);
}
}
static void DrawEdgeGlintWrap(MaterialProperty prop)
{
using var scope = new MaterialEditorGUI.PropertyScope(prop);
var normalized = ParaformMaterial.EdgeGlintWrapFromRaw(prop.floatValue);
normalized = MaterialEditorGUI.Slider("Edge Glint Wrap", normalized, 0, 1);
if (scope.Changed)
prop.floatValue = ParaformMaterial.EdgeGlintWrapToRaw(normalized);
}
static void DrawEdgeGlintSharpness(MaterialProperty prop)
{
using var scope = new MaterialEditorGUI.PropertyScope(prop);
var normalized = ParaformMaterial.EdgeGlintSharpnessFromRaw(prop.floatValue);
normalized = MaterialEditorGUI.Slider("Edge Glint Sharpness", normalized, 0.05f, .8f);
if (scope.Changed)
prop.floatValue = ParaformMaterial.EdgeGlintSharpnessToRaw(normalized);
}
static readonly GUIContent LABEL = new GUIContent();
static GUIContent GetPropGUIContent(MaterialProperty prop)
{
switch (prop.name)
{
case "_Vibrancy":
LABEL.tooltip = "(De)Saturate the image, 1 is normal, 0 is black and white, below zero make the image negative";
break;
case "_Brightness":
LABEL.tooltip = "Brighten/darken the image";
break;
case "_Flatten":
LABEL.tooltip = "Flatten the color behind to help keep contrast on varying background";
break;
default:
LABEL.tooltip = "";
break;
}
LABEL.text = prop.displayName;
return LABEL;
}
enum RefractionMode
{
Off,
On,
Chromatic
}
}
}

View File

@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 193075a2a61d481290894aded6229d9e
timeCreated: 1729245462
AssetOrigin:
serializedVersion: 1
productId: 78464
packageName: Translucent Image - Fast UI Background Blur
packageVersion: 6.5.0
assetPath: Assets/Le Tai's Asset/TranslucentImage/Script/Editor/TranslucentImageShaderGUI.cs
uploadId: 824068

View File

@@ -0,0 +1,107 @@
using System;
using System.Linq;
using LeTai.Common.Editor;
using UnityEditor;
using UnityEngine;
using UnityEngine.SceneManagement;
namespace LeTai.Asset.TranslucentImage.Editor
{
[CustomEditor(typeof(TranslucentImageSource))]
[CanEditMultipleObjects]
public class TranslucentImageSourceEditor : UnityEditor.Editor
{
ScalableBlurConfigEditor configEditor;
EditorProperty blurConfig;
EditorProperty downsample;
EditorProperty blurRegion;
EditorProperty maxUpdateRate;
EditorProperty cullPadding;
EditorProperty backgroundFill;
EditorProperty preview;
EditorProperty skipCulling;
void OnEnable()
{
blurConfig = new EditorProperty(serializedObject, nameof(TranslucentImageSource.BlurConfig));
downsample = new EditorProperty(serializedObject, nameof(TranslucentImageSource.Downsample));
blurRegion = new EditorProperty(serializedObject, nameof(TranslucentImageSource.BlurRegion));
maxUpdateRate = new EditorProperty(serializedObject, nameof(TranslucentImageSource.MaxUpdateRate));
cullPadding = new EditorProperty(serializedObject, nameof(TranslucentImageSource.CullPadding));
backgroundFill = new EditorProperty(serializedObject, nameof(TranslucentImageSource.BackgroundFill));
preview = new EditorProperty(serializedObject, nameof(TranslucentImageSource.Preview));
skipCulling = new EditorProperty(serializedObject, nameof(TranslucentImageSource.SkipCulling));
}
void OnDisable()
{
if (configEditor)
DestroyImmediate(configEditor);
}
public override void OnInspectorGUI()
{
EditorGUILayout.Space();
using (var configChange = new EditorGUI.ChangeCheckScope())
{
blurConfig.Draw();
var curConfig = (ScalableBlurConfig)blurConfig.serializedProperty.objectReferenceValue;
if (!curConfig)
{
EditorGUILayout.HelpBox("Missing Blur Config", MessageType.Warning);
if (GUILayout.Button("New Blur Config File"))
{
ScalableBlurConfig newConfig = CreateInstance<ScalableBlurConfig>();
var path = AssetDatabase.GenerateUniqueAssetPath(
$"Assets/{SceneManager.GetActiveScene().name} {serializedObject.targetObject.name} Blur Config.asset");
AssetDatabase.CreateAsset(newConfig, path);
AssetDatabase.SaveAssets();
AssetDatabase.Refresh();
EditorGUIUtility.PingObject(newConfig);
blurConfig.serializedProperty.objectReferenceValue = newConfig;
}
}
else
{
if (!configEditor || configChange.changed)
configEditor = (ScalableBlurConfigEditor)CreateEditor(curConfig);
configEditor.Draw();
}
}
EditorGUILayout.Space();
downsample.Draw();
using (var blurRegionChange = new EditorGUI.ChangeCheckScope())
{
blurRegion.Draw();
if (blurRegionChange.changed)
{
foreach (var source in targets.Cast<TranslucentImageSource>())
{
source.OnBlurRegionChanged();
}
}
}
maxUpdateRate.Draw();
if (maxUpdateRate.serializedProperty.floatValue < float.PositiveInfinity
&& skipCulling.serializedProperty.boolValue == false)
{
cullPadding.Draw();
if (cullPadding.serializedProperty.floatValue <= 0)
EditorGUILayout.HelpBox("When using a limited Max Update Rate with Culling enabled," +
" add some padding to prevent culled area being shown during UI movement.", MessageType.Warning);
}
backgroundFill.Draw();
preview.Draw();
skipCulling.Draw();
if (GUI.changed) serializedObject.ApplyModifiedProperties();
}
}
}

View File

@@ -0,0 +1,19 @@
fileFormatVersion: 2
guid: ec905d5b1e2c40f40b5cdd580f727f3e
timeCreated: 1539852387
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
AssetOrigin:
serializedVersion: 1
productId: 78464
packageName: Translucent Image - Fast UI Background Blur
packageVersion: 6.5.0
assetPath: Assets/Le Tai's Asset/TranslucentImage/Script/Editor/TranslucentImageSourceEditor.cs
uploadId: 824068