<< 📝 Description | 📌 Key Features | 🎮 Demo | ⚙ Installation | 🔄 Upgrading from v4 to v5 | 🚀 Usage | 🤝 Contributing >>
⚠️ This README is for v5. For v4, please visit here.
"Decorate your uGUI, simply and powerfully."
UIEffect is an open-source package that allows you to intuitively apply rich UI effects directly from the Inspector or via code.
Combine various filters, such as grayscale, blur, and dissolve, to decorate your UI with a unique visual style!
<font>
and <sprite>
tags.AnimationClips
.
This package requires Unity 2020.3 or later.
openupm add com.coffee.ui-effect
Window > Package Manager
) or run the following command with @{version}
:
openupm add com.coffee.ui-effect@5.0.0
Window > Package Manager
to open Package Manager UI.+ > Add package from git URL...
and input the repository URL: https://github.com/mob-sakai/UIEffect.git?path=Packages/src
#{version}
to the target version.
https://github.com/mob-sakai/UIEffect.git?path=Packages/src#5.0.0
Open the Packages/manifest.json
file in your project. Then add this package somewhere in the dependencies
block:
{
"dependencies": {
"com.coffee.ui-effect": "https://github.com/mob-sakai/UIEffect.git?path=Packages/src",
...
}
}
To update the package, change suffix #{version}
to the target version.
"com.coffee.ui-effect": "https://github.com/mob-sakai/UIEffect.git?path=Packages/src#5.0.0",
<extracted_dir>/Packages/src
directory in your project's Packages
directory.src
directory.UIEffect includes additional resources to import.
If upgrading from UIEffect v4 to v5, note the following breaking changes:
If you are installing via git URL, add ?path=Packages/src
. The default branch is changed upm
to main
.
// v4
"com.coffee.ui-effect": "https://github.com/mob-sakai/UIEffect.git",
"com.coffee.ui-effect": "https://github.com/mob-sakai/UIEffect.git#upm",
// v5
"com.coffee.ui-effect": "https://github.com/mob-sakai/UIEffect.git?path=Packages/src",
Import the v4 Compatible Components
sample from the Package Manager window.
All v4 components are obsolete.
UIEffect
component is now UIEffectV4
component. Change the reference in the code.effectArea
property in some components are not supported in v5.UIShadow
, UIGradient
, UIFlip
components are not supported in v5.UIEffect
component by selecting Convert To UIEffect
from the context menu.Add a UIEffect
component to a UI element (Image, RawImage, Text, TextMeshProUGUI, etc...) from the Add Component
in the inspector or Component > UI > UIEffect
menu.
Adjust the effect filters and parameters in the inspector.
Enjoy!
The UIEffect
component applies visual effects to UI elements, allowing various effects to be achieved by combining multiple filters.
None
, Grayscale
, Sepia
, Nega
, Retro
, Posterize
None
, Multiply
, Additive
, Subtractive
, Replace
, Multiply Luminance
, Multiply Additive
, Hsv Modifier
, Contrast
None
, Blur Fast
, Blur Medium
, Blur Detail
, Pixelation
, Rgb Shift
, Edge Luminescence
, Edge Alpha
None
, Fade
, Cutoff
, Dissolve
, Shiny
, Mask
, Melt
, Burn
None
, Hue
, Luminance
Alpha Blend
, Multiply
, Additive
, Soft Additive
, Multiply Additive
, Custom (SrcBlend, DstBlend)
None
, Shadow
, Shadow3
, Outline
, Outline8
, Mirror
The UIEffectTweener
component animates the effect, enabling easy control over effect animations without the need for an AnimationClip
.
Tone
, Color
, Sampling
, Transition
Forward (0.0 -> 1.0)
, Backward (1.0 -> 0.0)
Once
, Loop
, PingPongOnce
, PingPongLoop
Normal
, UnscaledTime
, Manual
The UIEffectReplica
component applies visual effects to UI elements by replicating the settings of another UIEffect
component. This allows the same effect to be applied across multiple UI elements simultaneously.
UIEffect
component to replicate.UIEffect supports TextMeshProUGUI elements. To use UIEffect with TextMeshPro, follow these steps:
First, you must import TMP Essential Resources before using.
Open the Package Manager
window and select the UI Effect
package in the package list and click the TextMeshPro Support > Import
button.
⚠️ If you are using Unity 2023.2/6000.0+
or TextMeshPro 3.2/4.0+
, click the TextMeshPro Support (Unity 6) > Import
button instead.
The assets will be imported under Assets/Samples/UI Effect/{version}
.
Add the UIEffect
component to a TextMeshProUGUI element and adjust the effect settings. The <font>
and <sprite>
tags are also supported.
You can create and use presets for UIEffect
components.
UIEffect
component inspector, click "Save As" button to save the current settings as an editor preset.UIEffect.LoadPreset(presetName)
method.You can control the effect settings and animations via code.
var effect = graphic.AddComponent<UIEffect>();
// Apply a preset
effect.LoadPreset("Dissolve");
// Set the effect parameters
effect.transitionWidth = 0.1f;
effect.transitionColor = Color.red;
// Add a tweener
var tweener = graphic.AddComponent<UIEffectTweener>();
tweener.cullingMask = UICullingMask.Tone;
tweener.wrapMode = UIWrapMode.PingPongLoop;
// Warm up the shader variant collection.
UIEffectProjectSettings.shaderVariantCollection.WarmUp();
You can adjust the project-wide settings for UIEffect. (Edit > Project Settings > UI > UIEffect
)
Low
, Medium
, High
Use Target Transform
is enabled in UIEffectReplica
component.UIEffect.LoadPreset(presetName)
method.Register Variant
: Adds the variant to Registered Variants
for runtime use.LogError
: Outputs a error and adds it to Unregistered Variants
.Here are the limitations of UIEffect:
SamplingFilter.BlurMedium
and SamplingFilter.BlurDetail
are not supported due to performance considerations.
SamplingFilter.BlurFast
.Issues are incredibly valuable to this project:
Pull requests offer a fantastic way to contribute your ideas to this repository.
Please refer to CONTRIBUTING.md
and use develop branch for development.
This is an open-source project developed during my spare time.
If you appreciate it, consider supporting me.
Your support allows me to dedicate more time to development. 😊