mirror of
https://github.com/mob-sakai/UIEffect.git
synced 2026-11-20 01:42:37 +08:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 16be53e145 | |||
| fd2d1b8059 | |||
| cf43bfffb9 | |||
| a2f4a2d5c9 | |||
| 0d7fb1eb63 | |||
| 145f56968a | |||
| cadbb8d68d | |||
| a0c3e4997a | |||
| ec57c2a994 | |||
| 804b48c73e | |||
| 01be18bb28 | |||
| 8addbad494 | |||
| dc5b3805d7 |
@@ -1,3 +1,39 @@
|
||||
## [5.9.5](https://github.com/mob-sakai/UIEffect/compare/5.9.4...5.9.5) (2025-06-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* `GetGradientKeys` and `GetTransitionGradientKeys` cannot get GradientMode ([fd2d1b8](https://github.com/mob-sakai/UIEffect/commit/fd2d1b80592ac4ea62e15b6150be63964b113fa2)), closes [#358](https://github.com/mob-sakai/UIEffect/issues/358)
|
||||
|
||||
## [5.9.4](https://github.com/mob-sakai/UIEffect/compare/5.9.3...5.9.4) (2025-06-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* colors specified in UIEffect are output differently in linear color space ([0d7fb1e](https://github.com/mob-sakai/UIEffect/commit/0d7fb1eb63881b67f2658567750a83c92187df35)), closes [#359](https://github.com/mob-sakai/UIEffect/issues/359)
|
||||
|
||||
## [5.9.3](https://github.com/mob-sakai/UIEffect/compare/5.9.2...5.9.3) (2025-06-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add `GetGradientKeys` and `GetTransitionGradientKeys` APIs ([a0c3e49](https://github.com/mob-sakai/UIEffect/commit/a0c3e4997af181ae16744c53ad3867e2106ccff3)), closes [#358](https://github.com/mob-sakai/UIEffect/issues/358)
|
||||
* support world canvas without UI events ([cadbb8d](https://github.com/mob-sakai/UIEffect/commit/cadbb8d68d17a2ec7e2d6e8e885d711e61fa53af)), closes [#356](https://github.com/mob-sakai/UIEffect/issues/356) [#357](https://github.com/mob-sakai/UIEffect/issues/357)
|
||||
|
||||
## [5.9.2](https://github.com/mob-sakai/UIEffect/compare/5.9.1...5.9.2) (2025-06-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* TextMeshPro 3.2.0-pre support ([804b48c](https://github.com/mob-sakai/UIEffect/commit/804b48c73ec648eaceb720cb79551fdbf3729fc9)), closes [#355](https://github.com/mob-sakai/UIEffect/issues/355)
|
||||
|
||||
## [5.9.1](https://github.com/mob-sakai/UIEffect/compare/5.9.0...5.9.1) (2025-06-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* prefabs will be deselected when editing them ([8addbad](https://github.com/mob-sakai/UIEffect/commit/8addbad4941340807d824e295280473d197d889f)), closes [#354](https://github.com/mob-sakai/UIEffect/issues/354)
|
||||
|
||||
# [5.9.0](https://github.com/mob-sakai/UIEffect/compare/5.8.7...5.9.0) (2025-06-09)
|
||||
|
||||
|
||||
|
||||
@@ -269,7 +269,7 @@ The `UIEffect` component applies visual effects to UI elements, allowing various
|
||||

|
||||
|
||||
- **Transition Filter**: `None`, `Fade`, `Cutoff`, `Dissolve`, `Shiny`, `Mask`, `Melt`, `Burn`, `Blaze`, `Pattern`
|
||||

|
||||

|
||||
- **Transition Rate**: 0.0 (no effect) - 1.0 (full effect).
|
||||
- **Transition Tex**: The texture used for the transition filter.
|
||||
- **Scale**, **Offset**, **Speed**, **Rotation**, **Keep Aspect Ratio**, **Reverse**: Additional properties for the texture.
|
||||
@@ -339,7 +339,7 @@ The `UIEffect` component applies visual effects to UI elements, allowing various
|
||||

|
||||
|
||||
- **Gradation Mode**: `None`, `Horizontal`, `HorizontalGradient`, `Vertical`, `VerticalGradient`, `Radial`, `RadialGradient`, `Diagonal`, `DiagonalToRightBottom`, `DiagonalToLeftBottom`, `Angle`, `AngleGradient`
|
||||

|
||||

|
||||
- **Gradation Color Filter**: `None`, `Multiply`, `Additive`, `Subtractive`, `Replace`, `Multiply Luminance`, `Multiply Additive`
|
||||
- **Gradation Gradient**: The gradient of the gradation. HDR colors are supported.
|
||||
- `Blend` and `Fixed` modes are available.
|
||||
|
||||
@@ -27,6 +27,11 @@
|
||||
"name": "com.unity.timeline",
|
||||
"expression": "1.0.0",
|
||||
"define": "TIMELINE_ENABLE"
|
||||
},
|
||||
{
|
||||
"name": "com.unity.textmeshpro",
|
||||
"expression": "[1.0.0,3.2.0-pre.1)",
|
||||
"define": "LEGACY_TMP_ENABLE"
|
||||
}
|
||||
],
|
||||
"noEngineReferences": false
|
||||
|
||||
@@ -112,8 +112,10 @@ namespace Coffee.UIEffects
|
||||
Vertical = 3,
|
||||
VerticalGradient = 4,
|
||||
Radial = 5,
|
||||
|
||||
[Obsolete]
|
||||
RadialFast = 5,
|
||||
|
||||
[Obsolete]
|
||||
RadialDetail = 6,
|
||||
RadialGradient = 12,
|
||||
|
||||
@@ -20,16 +20,18 @@ namespace Coffee.UIEffectInternal
|
||||
UpdateTmpCgincPath();
|
||||
}
|
||||
|
||||
private static void OnPostprocessAllAssets(string[] _, string[] __, string[] ___, string[] ____)
|
||||
private static void OnPostprocessAllAssets(string[] imported, string[] __, string[] ___, string[] ____)
|
||||
{
|
||||
UpdateTmpCgincPath();
|
||||
if (imported.Any(x => x.EndsWith(".cginc") || x.EndsWith(".shader")))
|
||||
{
|
||||
UpdateTmpCgincPath();
|
||||
}
|
||||
}
|
||||
|
||||
private static void UpdateTmpCgincPath()
|
||||
{
|
||||
if (s_CgincPattern == null || s_ShaderNames == null || s_ShaderNames.Length == 0) return;
|
||||
|
||||
AssetDatabase.StartAssetEditing();
|
||||
string[] cgincs = null;
|
||||
foreach (var shaderName in s_ShaderNames)
|
||||
{
|
||||
@@ -47,8 +49,6 @@ namespace Coffee.UIEffectInternal
|
||||
|
||||
UpdateTmpCgincPath(shader, cgincs);
|
||||
}
|
||||
|
||||
AssetDatabase.StopAssetEditing();
|
||||
}
|
||||
|
||||
private static void UpdateTmpCgincPath(Shader shader, string[] cgincs)
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
// #if TIMELINE_ENABLE
|
||||
// using System;
|
||||
// using System.ComponentModel;
|
||||
// using UnityEngine;
|
||||
//
|
||||
// namespace Coffee.UIEffects.Timeline
|
||||
// {
|
||||
// [DisplayName("Clip")]
|
||||
// public class UIEffectFloat01Clip : UIEffectClip<UIEffectFloatBehaviour>
|
||||
// {
|
||||
// }
|
||||
//
|
||||
// // [Serializable]
|
||||
// // public class UIEffectFloat01Behaviour : UIEffectFloatBehaviour
|
||||
// // {
|
||||
// // [Range(0, 1)]
|
||||
// // public float m_Value = 1;
|
||||
// //
|
||||
// // [Range(0, 1)]
|
||||
// // public float m_From = 1;
|
||||
// //
|
||||
// // protected override float from => m_From;
|
||||
// // protected override float value => m_Value;
|
||||
// // }
|
||||
//
|
||||
// // public class UIEffectFloatBehaviour : UIEffectBehaviour, IGetValue<float>
|
||||
// // {
|
||||
// // protected virtual float value { get; }
|
||||
// // protected virtual float from { get; }
|
||||
// //
|
||||
// // public float Get(float time)
|
||||
// // {
|
||||
// // return m_Tween
|
||||
// // ? Mathf.Lerp(from, value, m_Curve.Evaluate(time))
|
||||
// // : value;
|
||||
// // }
|
||||
// // }
|
||||
// //
|
||||
// // public abstract class UIEffectFloatMixerBehaviour : UIEffectMixerBehaviour<float, UIEffectFloatBehaviour>
|
||||
// // {
|
||||
// // protected override float Add(float baseValue, float value, float weight)
|
||||
// // {
|
||||
// // return baseValue + value * weight;
|
||||
// // }
|
||||
// //
|
||||
// // protected override float Lerp(float defaultValue, float value, float weight)
|
||||
// // {
|
||||
// // return Mathf.Lerp(defaultValue, value, weight);
|
||||
// // }
|
||||
// // }
|
||||
// }
|
||||
//
|
||||
// #endif
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: deea59e7cd34449c89e7c1f6438a5392
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -76,7 +76,6 @@ namespace Coffee.UIEffects.Timeline
|
||||
|
||||
private void OnValidate()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1519,6 +1519,17 @@ namespace Coffee.UIEffects
|
||||
SetGradientKeys(gradient.colorKeys, gradient.alphaKeys, gradient.mode);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get gradation gradient's keys.
|
||||
/// </summary>
|
||||
public void GetGradientKeys(out GradientColorKey[] colorKeys, out GradientAlphaKey[] alphaKeys,
|
||||
out GradientMode mode)
|
||||
{
|
||||
colorKeys = m_GradationGradient?.colorKeys ?? Array.Empty<GradientColorKey>();
|
||||
alphaKeys = m_GradationGradient?.alphaKeys ?? Array.Empty<GradientAlphaKey>();
|
||||
mode = m_GradationGradient?.mode ?? GradientMode.Blend;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set transition gradient's keys.
|
||||
/// </summary>
|
||||
@@ -1527,6 +1538,17 @@ namespace Coffee.UIEffects
|
||||
SetTransitionGradientKeys(gradient.colorKeys, gradient.alphaKeys, gradient.mode);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get transition gradation gradient's keys.
|
||||
/// </summary>
|
||||
public void GetTransitionGradientKeys(out GradientColorKey[] colorKeys, out GradientAlphaKey[] alphaKeys,
|
||||
out GradientMode mode)
|
||||
{
|
||||
colorKeys = m_TransitionGradient?.colorKeys ?? Array.Empty<GradientColorKey>();
|
||||
alphaKeys = m_TransitionGradient?.alphaKeys ?? Array.Empty<GradientAlphaKey>();
|
||||
mode = m_TransitionGradient?.mode ?? GradientMode.Blend;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set gradation gradient's keys.
|
||||
/// </summary>
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Coffee.UIEffects
|
||||
[DisallowMultipleComponent]
|
||||
public abstract class UIEffectBase : UIBehaviour, IMeshModifier, IMaterialModifier, ICanvasRaycastFilter
|
||||
#if TIMELINE_ENABLE
|
||||
,ITimeControl
|
||||
, ITimeControl
|
||||
#endif
|
||||
{
|
||||
private static readonly InternalObjectPool<UIEffectContext> s_ContextPool =
|
||||
|
||||
@@ -294,7 +294,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
var x = m_GradationReverse ? w - 1 - i : i;
|
||||
var t = (float)i / (w - 1);
|
||||
s_Colors[x] = m_GradationGradient.Evaluate(t);
|
||||
s_Colors[x] = ApplyColorSpace(m_GradationGradient.Evaluate(t));
|
||||
}
|
||||
|
||||
_gradationRampTex.wrapMode = m_GradationWrapMode;
|
||||
@@ -320,7 +320,7 @@ namespace Coffee.UIEffects
|
||||
for (var i = 0; i < w; i++)
|
||||
{
|
||||
var t = (float)i / (w - 1);
|
||||
s_Colors[i] = m_TransitionGradient.Evaluate(t);
|
||||
s_Colors[i] = ApplyColorSpace(m_TransitionGradient.Evaluate(t));
|
||||
}
|
||||
|
||||
s_Colors[w - 1].a = 0;
|
||||
@@ -454,7 +454,7 @@ namespace Coffee.UIEffects
|
||||
material.SetFloat(s_ToneIntensity, Mathf.Clamp01(m_ToneIntensity));
|
||||
|
||||
material.SetInt(s_ColorFilter, (int)m_ColorFilter);
|
||||
material.SetColor(s_ColorValue, m_Color);
|
||||
material.SetColor(s_ColorValue, ApplyColorSpace(m_Color));
|
||||
material.SetFloat(s_ColorIntensity, Mathf.Clamp01(m_ColorIntensity));
|
||||
material.SetInt(s_ColorGlow, m_ColorGlow ? 1 : 0);
|
||||
|
||||
@@ -473,14 +473,14 @@ namespace Coffee.UIEffects
|
||||
material.SetFloat(s_TransitionSoftness, Mathf.Clamp01(m_TransitionSoftness));
|
||||
material.SetVector(s_TransitionRange, new Vector2(m_TransitionRange.min, m_TransitionRange.max));
|
||||
material.SetInt(s_TransitionColorFilter, (int)m_TransitionColorFilter);
|
||||
material.SetColor(s_TransitionColor, m_TransitionColor);
|
||||
material.SetColor(s_TransitionColor, ApplyColorSpace(m_TransitionColor));
|
||||
material.SetInt(s_TransitionColorGlow, m_TransitionColorGlow ? 1 : 0);
|
||||
material.SetInt(s_TransitionPatternReverse, m_TransitionPatternReverse ? 1 : 0);
|
||||
material.SetFloat(s_TransitionAutoPlaySpeed, m_TransitionAutoPlaySpeed);
|
||||
material.SetTexture(s_TransitionGradientTex,
|
||||
m_TransitionFilter == TransitionFilter.Blaze ? transitionRampTex : null);
|
||||
|
||||
material.SetColor(s_TargetColor, m_TargetColor);
|
||||
material.SetColor(s_TargetColor, ApplyColorSpace(m_TargetColor));
|
||||
material.SetFloat(s_TargetRange, Mathf.Clamp01(m_TargetRange));
|
||||
material.SetFloat(s_TargetSoftness, Mathf.Clamp01(m_TargetSoftness));
|
||||
|
||||
@@ -497,12 +497,12 @@ namespace Coffee.UIEffects
|
||||
}
|
||||
|
||||
material.SetInt(s_ShadowColorFilter, (int)m_ShadowColorFilter);
|
||||
material.SetColor(s_ShadowColor, m_ShadowColor);
|
||||
material.SetColor(s_ShadowColor, ApplyColorSpace(m_ShadowColor));
|
||||
material.SetInt(s_ShadowColorGlow, m_ShadowColorGlow ? 1 : 0);
|
||||
|
||||
material.SetFloat(s_EdgeWidth, Mathf.Clamp01(m_EdgeWidth));
|
||||
material.SetInt(s_EdgeColorFilter, (int)m_EdgeColorFilter);
|
||||
material.SetColor(s_EdgeColor, m_EdgeColor);
|
||||
material.SetColor(s_EdgeColor, ApplyColorSpace(m_EdgeColor));
|
||||
material.SetInt(s_EdgeColorGlow, m_EdgeColorGlow ? 1 : 0);
|
||||
material.SetFloat(s_EdgeShinyRate, Mathf.Clamp01(m_EdgeShinyRate));
|
||||
material.SetFloat(s_EdgeShinyWidth, Mathf.Clamp01(m_EdgeShinyWidth));
|
||||
@@ -514,10 +514,10 @@ namespace Coffee.UIEffects
|
||||
|
||||
material.SetFloat(s_GradationIntensity, m_GradationIntensity);
|
||||
material.SetInt(s_GradationColorFilter, (int)m_GradationColorFilter);
|
||||
material.SetColor(s_GradationColor1, m_GradationColor1);
|
||||
material.SetColor(s_GradationColor2, m_GradationColor2);
|
||||
material.SetColor(s_GradationColor3, m_GradationColor3);
|
||||
material.SetColor(s_GradationColor4, m_GradationColor4);
|
||||
material.SetColor(s_GradationColor1, ApplyColorSpace(m_GradationColor1));
|
||||
material.SetColor(s_GradationColor2, ApplyColorSpace(m_GradationColor2));
|
||||
material.SetColor(s_GradationColor3, ApplyColorSpace(m_GradationColor3));
|
||||
material.SetColor(s_GradationColor4, ApplyColorSpace(m_GradationColor4));
|
||||
material.SetInt(s_GradationRadial, m_GradationMode == GradationMode.Radial
|
||||
#pragma warning disable CS0612 // Type or member is obsolete
|
||||
|| m_GradationMode == GradationMode.RadialDetail
|
||||
@@ -525,7 +525,7 @@ namespace Coffee.UIEffects
|
||||
|| m_GradationMode == GradationMode.RadialGradient ? 1 : 0);
|
||||
|
||||
material.SetFloat(s_DetailIntensity, Mathf.Clamp01(m_DetailIntensity));
|
||||
material.SetColor(s_DetailColor, m_DetailColor);
|
||||
material.SetColor(s_DetailColor, ApplyColorSpace(m_DetailColor));
|
||||
material.SetVector(s_DetailThreshold, new Vector2(m_DetailThreshold.min, m_DetailThreshold.max));
|
||||
material.SetTexture(s_DetailTex, m_DetailFilter != 0 ? m_DetailTex : null);
|
||||
material.SetVector(s_DetailTex_ST,
|
||||
@@ -623,7 +623,11 @@ namespace Coffee.UIEffects
|
||||
* Matrix4x4.TRS(mirrorOffset, Quaternion.identity, mirrorScale) * w2LMat);
|
||||
}
|
||||
|
||||
if (canvas.renderMode == RenderMode.ScreenSpaceOverlay || !canvas.worldCamera)
|
||||
if (canvas.renderMode == RenderMode.WorldSpace)
|
||||
{
|
||||
material.SetMatrix(s_CanvasToWorldMatrix, Matrix4x4.identity);
|
||||
}
|
||||
else if (canvas.renderMode == RenderMode.ScreenSpaceOverlay || !canvas.worldCamera)
|
||||
{
|
||||
material.SetMatrix(s_CanvasToWorldMatrix, canvas.transform.localToWorldMatrix);
|
||||
}
|
||||
@@ -830,5 +834,10 @@ namespace Coffee.UIEffects
|
||||
|
||||
return expandSize;
|
||||
}
|
||||
|
||||
private static Color ApplyColorSpace(Color color)
|
||||
{
|
||||
return QualitySettings.activeColorSpace == ColorSpace.Linear ? color.linear : color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace Coffee.UIEffects
|
||||
[InitializeOnLoadMethod]
|
||||
private static void InitializeOnLoadMethod()
|
||||
{
|
||||
#if UNITY_2023_2_OR_NEWER
|
||||
#if !LEGACY_TMP_ENABLE
|
||||
const string tmpSupport = "TextMeshPro Support (Unity 6)";
|
||||
const string version = "v5.9.0 (Unity 6)";
|
||||
#else
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "com.coffee.ui-effect",
|
||||
"displayName": "UI Effect",
|
||||
"description": "UIEffect is an open-source package that allows you to intuitively apply rich UI effects directly from the Inspector or via code.\nCombine various filters, such as grayscale, blur, and dissolve, to decorate your UI with a unique visual style!",
|
||||
"version": "5.9.0",
|
||||
"version": "5.9.5",
|
||||
"unity": "2020.3",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
Reference in New Issue
Block a user