mirror of
https://github.com/mob-sakai/UIEffect.git
synced 2026-11-20 18:02:38 +08:00
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:
+11
-11
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user