Skip to content

Commit

Permalink
4.0.0-preview.9
Browse files Browse the repository at this point in the history
# [4.0.0-preview.9](mob-sakai/UIEffect@v4.0.0-preview.8...v4.0.0-preview.9) (2020-06-09)

### Features

* add a new property to access EffectPlayer at runtime ([d92efa9](mob-sakai@d92efa9)), closes [mob-sakai#214](mob-sakai#214) [mob-sakai#215](mob-sakai#215)
  • Loading branch information
semantic-release-bot committed Jun 9, 2020
1 parent 7371e88 commit b43e405
Show file tree
Hide file tree
Showing 14 changed files with 44 additions and 43 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [4.0.0-preview.9](https://github.com/mob-sakai/UIEffect/compare/v4.0.0-preview.8...v4.0.0-preview.9) (2020-06-09)


### Features

* add a new property to access EffectPlayer at runtime ([d92efa9](https://github.com/mob-sakai/UIEffect/commit/d92efa98a1fc7b78d3421d9ee0b4bdaa74511bdc)), closes [#214](https://github.com/mob-sakai/UIEffect/issues/214) [#215](https://github.com/mob-sakai/UIEffect/issues/215)

# [4.0.0-preview.8](https://github.com/mob-sakai/UIEffect/compare/v4.0.0-preview.7...v4.0.0-preview.8) (2020-06-04)


Expand Down
2 changes: 1 addition & 1 deletion Resources/UIDissolve.shader
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Shader "Hidden/UIDissolve"
Shader "Hidden/UI/Default (UIDissolve)"
{
Properties
{
Expand Down
2 changes: 1 addition & 1 deletion Resources/UIEffect.shader
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Shader "Hidden/UIEffect"
Shader "Hidden/UI/Default (UIEffect)"
{
Properties
{
Expand Down
18 changes: 9 additions & 9 deletions Resources/UIHsvModifier.shader
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Shader "Hidden/UIHsvModifier"
Shader "Hidden/UI/Default (UIHsvModifier)"
{
Properties
{
[PerRendererData] _MainTex ("Main Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)

_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
Expand All @@ -21,19 +21,19 @@
SubShader
{
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
}

Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Expand Down Expand Up @@ -76,4 +76,4 @@
ENDCG
}
}
}
}
24 changes: 12 additions & 12 deletions Resources/UIShiny.shader
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Shader "Hidden/UIShiny"
Shader "Hidden/UI/Default (UIShiny)"
{
Properties
{
[PerRendererData] _MainTex ("Main Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)

_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
Expand All @@ -21,19 +21,19 @@ Shader "Hidden/UIShiny"
SubShader
{
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
}

Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Expand All @@ -53,9 +53,9 @@ Shader "Hidden/UIShiny"
#pragma vertex vert
#pragma fragment frag
#pragma target 2.0

#pragma multi_compile __ UNITY_UI_ALPHACLIP

#include "UnityCG.cginc"
#include "UnityUI.cginc"

Expand All @@ -69,11 +69,11 @@ Shader "Hidden/UIShiny"
color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);

color = ApplyShinyEffect(color, IN.eParam);

#ifdef UNITY_UI_ALPHACLIP
clip (color.a - 0.001);
#endif

return color;
}
ENDCG
Expand Down
2 changes: 1 addition & 1 deletion Resources/UITtransition.shader
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Shader "Hidden/UITransition"
Shader "Hidden/UI/Default (UITransition)"
{
Properties
{
Expand Down
6 changes: 4 additions & 2 deletions Scripts/Common/BaseMaterialEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,13 @@ protected override void OnValidate()
/// </summary>
protected override void OnEnable()
{
base.OnEnable();

if (paramTex != null)
{
paramTex.Register(this);
}

SetVerticesDirty();
SetMaterialDirty();
SetEffectParamsDirty();

Expand All @@ -149,7 +150,8 @@ protected override void OnEnable()
/// </summary>
protected override void OnDisable()
{
SetVerticesDirty();
base.OnDisable();

SetMaterialDirty();

if (paramTex != null)
Expand Down
8 changes: 0 additions & 8 deletions Scripts/Common/GraphicConnector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,6 @@ public virtual void SetMaterialDirty(Graphic graphic)
graphic.SetMaterialDirty();
}

/// <summary>
/// Event that is called just before Canvas rendering happens.
/// This allows you to delay processing / updating of canvas based elements until just before they are rendered.
/// </summary>
protected virtual void OnWillRenderCanvases()
{
}

/// <summary>
/// Gets position factor for area.
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions Scripts/UIDissolve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public override ParameterTexture paramTex
get { return s_ParamTex; }
}

EffectPlayer effectPlayer
public EffectPlayer effectPlayer
{
get { return m_Player ?? (m_Player = new EffectPlayer()); }
}
Expand All @@ -219,7 +219,7 @@ public override Hash128 GetMaterialHash(Material material)
public override void ModifyMaterial(Material newMaterial, Graphic graphic)
{
var connector = GraphicConnector.FindConnector(graphic);
newMaterial.shader = connector.FindShader("UIDissolve");
newMaterial.shader = Shader.Find(string.Format("Hidden/{0} (UIDissolve)", newMaterial.shader.name));
SetShaderVariants(newMaterial, m_ColorMode);

newMaterial.SetTexture(k_TransitionTexId, transitionTexture);
Expand Down
2 changes: 1 addition & 1 deletion Scripts/UIEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public override void ModifyMaterial(Material newMaterial, Graphic graphic)
{
var connector = GraphicConnector.FindConnector(graphic);

newMaterial.shader = connector.FindShader("UIEffect");
newMaterial.shader = Shader.Find(string.Format("Hidden/{0} (UIEffect)", newMaterial.shader.name));
SetShaderVariants(newMaterial, m_EffectMode, m_ColorMode, m_BlurMode,
m_AdvancedBlur ? BlurEx.Ex : BlurEx.None);

Expand Down
2 changes: 1 addition & 1 deletion Scripts/UIHsvModifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public override void ModifyMaterial(Material newMaterial, Graphic graphic)
{
var connector = GraphicConnector.FindConnector(graphic);

newMaterial.shader = connector.FindShader("UIHsvModifier");
newMaterial.shader = Shader.Find(string.Format("Hidden/{0} (UIHsvModifier)", newMaterial.shader.name));
paramTex.RegisterMaterial(newMaterial);
}

Expand Down
4 changes: 2 additions & 2 deletions Scripts/UIShiny.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public override ParameterTexture paramTex
get { return s_ParamTex; }
}

EffectPlayer effectPlayer
public EffectPlayer effectPlayer
{
get { return m_Player ?? (m_Player = new EffectPlayer()); }
}
Expand Down Expand Up @@ -194,7 +194,7 @@ public override void ModifyMaterial(Material newMaterial, Graphic graphic)
{
var connector = GraphicConnector.FindConnector(graphic);

newMaterial.shader = connector.FindShader("UIShiny");
newMaterial.shader = Shader.Find(string.Format("Hidden/{0} (UIShiny)", newMaterial.shader.name));
paramTex.RegisterMaterial(newMaterial);
}

Expand Down
4 changes: 2 additions & 2 deletions Scripts/UITransitionEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public bool passRayOnHidden
set { m_PassRayOnHidden = value; }
}

EffectPlayer effectPlayer
public EffectPlayer effectPlayer
{
get { return m_Player ?? (m_Player = new EffectPlayer()); }
}
Expand Down Expand Up @@ -234,7 +234,7 @@ public override Hash128 GetMaterialHash(Material material)
public override void ModifyMaterial(Material newMaterial, Graphic graphic)
{
var connector = GraphicConnector.FindConnector(graphic);
newMaterial.shader = connector.FindShader("UITransition");
newMaterial.shader = Shader.Find(string.Format("Hidden/{0} (UITransition)", newMaterial.shader.name));
SetShaderVariants(newMaterial, m_EffectMode);

newMaterial.SetTexture(k_TransitionTexId, transitionTexture);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "com.coffee.ui-effect",
"displayName": "UI Effect",
"description": "UI Effect provides visual effect components for Unity UI.\nLet's decorate your UI with effects!",
"version": "4.0.0-preview.8",
"version": "4.0.0-preview.9",
"unity": "2017.1",
"license": "MIT",
"repository": {
Expand Down

0 comments on commit b43e405

Please sign in to comment.