4.0.0-preview.8

# [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)

### change

* change namespace ([7f4190c](https://github.com/mob-sakai/UIEffect/commit/7f4190c8c6f294e90869767a96194ec5ac4ba57f))

### Features

* modify EffectPlayer at runtime ([8483ba6](https://github.com/mob-sakai/UIEffect/commit/8483ba63cb546ca032915c166c0333fa5fd7aa76)), closes [#214](https://github.com/mob-sakai/UIEffect/issues/214) [#215](https://github.com/mob-sakai/UIEffect/issues/215)

### BREAKING CHANGES

* If your code contained the UIEffect API, it would fail to compile. Please change the namespace from  to .
This commit is contained in:
semantic-release-bot
2020-06-04 08:22:42 +00:00
parent 07926376c6
commit 7371e889ad
38 changed files with 170 additions and 264 deletions
+11 -11
View File
@@ -7,7 +7,7 @@ using System.Text;
using System.Linq;
using System.IO;
namespace Coffee.UIExtensions
namespace Coffee.UIEffects
{
/// <summary>
/// Dissolve effect for uGUI.
@@ -196,6 +196,11 @@ namespace Coffee.UIExtensions
get { return s_ParamTex; }
}
EffectPlayer effectPlayer
{
get { return m_Player ?? (m_Player = new EffectPlayer()); }
}
public override Hash128 GetMaterialHash(Material material)
{
if (!isActiveAndEnabled || !material || !material.shader)
@@ -213,7 +218,7 @@ namespace Coffee.UIExtensions
public override void ModifyMaterial(Material newMaterial, Graphic graphic)
{
var connector = BaseConnector.FindConnector(graphic);
var connector = GraphicConnector.FindConnector(graphic);
newMaterial.shader = connector.FindShader("UIDissolve");
SetShaderVariants(newMaterial, m_ColorMode);
@@ -288,7 +293,7 @@ namespace Coffee.UIExtensions
/// </summary>
public void Play(bool reset = true)
{
_player.Play(reset);
effectPlayer.Play(reset);
}
/// <summary>
@@ -296,24 +301,19 @@ namespace Coffee.UIExtensions
/// </summary>
public void Stop(bool reset = true)
{
_player.Stop(reset);
effectPlayer.Stop(reset);
}
protected override void OnEnable()
{
base.OnEnable();
_player.OnEnable((f) => effectFactor = m_Reverse ? 1f - f : f);
effectPlayer.OnEnable((f) => effectFactor = m_Reverse ? 1f - f : f);
}
protected override void OnDisable()
{
base.OnDisable();
_player.OnDisable();
}
EffectPlayer _player
{
get { return m_Player ?? (m_Player = new EffectPlayer()); }
effectPlayer.OnDisable();
}
}
}