mirror of
https://github.com/mob-sakai/UIEffect.git
synced 2026-11-20 09:52:38 +08:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3a295f8677 | |||
| b2c4e58de2 | |||
| f8eeb4a5db | |||
| 674c1e858b | |||
| 67c35affec | |||
| 7fe0b44e56 | |||
| 0c2a515abc | |||
| 2c7df2a749 | |||
| cc02d8945b | |||
| 866cf34048 |
@@ -112,7 +112,7 @@ namespace UnityEditor.UI
|
||||
+ (0 < tone ? "-" + tone : "")
|
||||
+ (0 < color ? "-" + color : "")
|
||||
+ (0 < blur ? "-" + blur : "");
|
||||
mat.hideFlags = HideFlags.NotEditable;
|
||||
//mat.hideFlags = HideFlags.NotEditable;
|
||||
|
||||
Directory.CreateDirectory("Assets/UIEffect/Materials");
|
||||
AssetDatabase.CreateAsset(mat, "Assets/UIEffect/Materials/" + mat.name + ".mat");
|
||||
@@ -217,14 +217,17 @@ namespace UnityEditor.UI
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
|
||||
#if UNITY_5_6_OR_NEWER
|
||||
var canvas = (target as UIEffect).graphic.canvas;
|
||||
if( 0 == (canvas.additionalShaderChannels & AdditionalCanvasShaderChannels.TexCoord1))
|
||||
if((target as UIEffect).graphic)
|
||||
{
|
||||
using (new GUILayout.HorizontalScope())
|
||||
var canvas = (target as UIEffect).graphic.canvas;
|
||||
if( canvas && 0 == (canvas.additionalShaderChannels & AdditionalCanvasShaderChannels.TexCoord1))
|
||||
{
|
||||
EditorGUILayout.HelpBox("[Unity5.6+] Enable TexCoord1 of Canvas.additionalShaderChannels to use UIEffect.", MessageType.Warning);
|
||||
if (GUILayout.Button("Fix"))
|
||||
canvas.additionalShaderChannels |= AdditionalCanvasShaderChannels.TexCoord1;
|
||||
using (new GUILayout.HorizontalScope())
|
||||
{
|
||||
EditorGUILayout.HelpBox("[Unity5.6+] Enable TexCoord1 of Canvas.additionalShaderChannels to use UIEffect.", MessageType.Warning);
|
||||
if (GUILayout.Button("Fix"))
|
||||
canvas.additionalShaderChannels |= AdditionalCanvasShaderChannels.TexCoord1;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -3,6 +3,8 @@ UIEffect
|
||||
|
||||

|
||||
|
||||
[WebGL Demo](https://developer.cloud.unity3d.com/share/WyQetw3p-X/webgl/)
|
||||
|
||||
Easy to use effects for uGUI. Supports following effects.
|
||||
|
||||
* Grayscale tone
|
||||
@@ -29,7 +31,7 @@ Easy to use effects for uGUI. Supports following effects.
|
||||

|
||||
* Capture image with effect, like post effect
|
||||

|
||||
* Dialog with captured image effect.
|
||||
* Dialog with captured image effect
|
||||

|
||||
|
||||
|
||||
@@ -66,7 +68,8 @@ This effect is non-realtime, light-weight, less-camera, blit only once, but effe
|
||||
* Process effect only once after `UIEffectCapturedImage.Capture`.
|
||||
* Using reduction buffer, keep used memory size small and keep rendering load are small.
|
||||
* When GameObjects with motion are on the screen, a result texture may be stirred.
|
||||
* You can overlay and display like as: [Screen] | [UIEffectCapturedImage] | [Dialog A] | [UIEffectCapturedImage] | [Dialog B]. See also demo.
|
||||
* You can overlay and display like as: [Screen] | [UIEffectCapturedImage] | [Dialog A] | [UIEffectCapturedImage] | [Dialog B].
|
||||
See also [WebGL Demo](https://developer.cloud.unity3d.com/share/WyQetw3p-X/webgl/).
|
||||
|
||||
|
||||
|
||||
@@ -83,7 +86,7 @@ Please enable `TexCoord1` to use UIEffect.
|
||||
|
||||
## Demo
|
||||
|
||||
[WebGL Demo](https://developer.cloud.unity3d.com/share/b18LwIciWX/webgl/)
|
||||
[WebGL Demo](https://developer.cloud.unity3d.com/share/WyQetw3p-X/webgl/)
|
||||
|
||||
* Effect sample
|
||||
* Transition
|
||||
@@ -95,6 +98,26 @@ Please enable `TexCoord1` to use UIEffect.
|
||||
|
||||
## Release Notes
|
||||
|
||||
### ver.1.4.4
|
||||
|
||||
* Fixed: Error has occur on edit prefab. [#27](https://github.com/mob-sakai/UIEffect/issues/27)
|
||||
|
||||
|
||||
### ver.1.4.3
|
||||
|
||||
* Fixed: Color effect is incorrect. [#19](https://github.com/mob-sakai/UIEffect/issues/19)
|
||||
|
||||
|
||||
### ver.1.4.2
|
||||
|
||||
* Fixed: Error has occur on after deserialize. [#16](https://github.com/mob-sakai/UIEffect/issues/16)
|
||||
|
||||
|
||||
### ver.1.4.1
|
||||
|
||||
* Fixed: Demo link in `readme.md` is broken.
|
||||
|
||||
|
||||
### ver.1.4.0
|
||||
|
||||
* Changed: ToneMode, ColorMode, BlurMode can be changed only in editor.
|
||||
|
||||
@@ -171,7 +171,7 @@ Shader "UI/Hidden/UI-Effect"
|
||||
#endif
|
||||
|
||||
#if defined (UI_COLOR)
|
||||
color = ApplyColorEffect(color, IN.colorFactor); // Color effect.
|
||||
color = ApplyColorEffect(color, IN.colorFactor) * IN.color; // Color effect.
|
||||
#endif
|
||||
|
||||
return color;
|
||||
|
||||
@@ -329,16 +329,19 @@ namespace UnityEngine.UI
|
||||
|
||||
public void OnAfterDeserialize()
|
||||
{
|
||||
var obj = this;
|
||||
EditorApplication.delayCall += () =>
|
||||
{
|
||||
var old = m_EffectMaterial;
|
||||
m_EffectMaterial = GetMaterial(Shader.Find(shaderName), toneMode, colorMode, blurMode);
|
||||
if (old != m_EffectMaterial)
|
||||
{
|
||||
EditorUtility.SetDirty(this);
|
||||
EditorApplication.delayCall +=AssetDatabase.SaveAssets;
|
||||
}
|
||||
graphic.material = m_EffectMaterial;
|
||||
if (Application.isPlaying || !obj)
|
||||
return;
|
||||
|
||||
var mat = GetMaterial(Shader.Find(shaderName), toneMode, colorMode, blurMode);
|
||||
if(m_EffectMaterial == mat)
|
||||
return;
|
||||
|
||||
graphic.material = m_EffectMaterial = mat;
|
||||
EditorUtility.SetDirty(this);
|
||||
EditorApplication.delayCall +=AssetDatabase.SaveAssets;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user