mirror of
https://github.com/mob-sakai/UIEffect.git
synced 2026-11-20 09:52:38 +08:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3a295f8677 | |||
| b2c4e58de2 | |||
| f8eeb4a5db | |||
| 674c1e858b | |||
| 67c35affec | |||
| 7fe0b44e56 |
@@ -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
|
||||
|
||||
@@ -98,14 +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.
|
||||
* 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;
|
||||
|
||||
@@ -332,17 +332,16 @@ namespace UnityEngine.UI
|
||||
var obj = this;
|
||||
EditorApplication.delayCall += () =>
|
||||
{
|
||||
if (!obj)
|
||||
if (Application.isPlaying || !obj)
|
||||
return;
|
||||
|
||||
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;
|
||||
|
||||
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