mirror of
https://github.com/mob-sakai/UIEffect.git
synced 2026-11-20 01:42:37 +08:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3eb775dcf5 | |||
| 1af89af2c5 | |||
| f0a76424e6 | |||
| f2753e9a3d | |||
| 91e5be706d | |||
| 8513970e6f | |||
| 3f5a7dcd2d | |||
| a748adf1bd | |||
| 40ff828ff0 | |||
| bdbf293c14 | |||
| 8155f94943 | |||
| 0a99bb7765 | |||
| 6b6ff3e1d8 | |||
| 8cbcd765ed | |||
| 6f6a8c95f8 |
@@ -1,5 +1,6 @@
|
||||
#if UNITY_EDITOR
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
@@ -31,17 +32,23 @@ internal static class ImportSample
|
||||
|
||||
private static void Run(string sample)
|
||||
{
|
||||
#if UNITY_EDITOR_WIN
|
||||
var bash = @"C:\Program Files\Git\bin\bash.exe";
|
||||
if (!File.Exists(bash))
|
||||
{
|
||||
bash = @"C:\Program Files (x86)\Git\bin\bash.exe";
|
||||
}
|
||||
#else
|
||||
var bash = "/bin/bash";
|
||||
#endif
|
||||
|
||||
var p = new Process()
|
||||
{
|
||||
StartInfo = new ProcessStartInfo()
|
||||
{
|
||||
Arguments = $"import-tmp-support.sh '{sample}'",
|
||||
CreateNoWindow = true,
|
||||
#if UNITY_EDITOR_WIN
|
||||
FileName = @"C:\Program Files (x86)\Git\bin\bash.exe",
|
||||
#else
|
||||
FileName = "/bin/bash",
|
||||
#endif
|
||||
FileName = bash,
|
||||
RedirectStandardError = true,
|
||||
RedirectStandardOutput = true,
|
||||
WorkingDirectory = $"{Application.dataPath}/..",
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"depth": 0,
|
||||
"source": "git",
|
||||
"dependencies": {},
|
||||
"hash": "2045eaab5b485827cef8bf0bb9e1552dce4f8d6d"
|
||||
"hash": "2bd2bf356dd692a39de9db2ff11faaf79fbfaea3"
|
||||
},
|
||||
"com.coffee.nano-monitor": {
|
||||
"version": "https://github.com/mob-sakai/Coffee.Internal.git?path=Packages/NanoMonitor",
|
||||
|
||||
@@ -1,3 +1,31 @@
|
||||
## [5.5.3](https://github.com/mob-sakai/UIEffect/compare/5.5.2...5.5.3) (2025-03-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* blur with 'Filled' Image type may cause error ([f0a7642](https://github.com/mob-sakai/UIEffect/commit/f0a76424e690355c101cc2e12183d1a7e77b16c3)), closes [#313](https://github.com/mob-sakai/UIEffect/issues/313)
|
||||
* IL2CPP build fails on older versions of Unity ([1af89af](https://github.com/mob-sakai/UIEffect/commit/1af89af2c58320f67b8d753767b3b4cf905f844d)), closes [#315](https://github.com/mob-sakai/UIEffect/issues/315)
|
||||
|
||||
## [5.5.2](https://github.com/mob-sakai/UIEffect/compare/5.5.1...5.5.2) (2025-02-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* `PlayOnEnable.Reverse` in UIEffectTweener does not work ([3f5a7dc](https://github.com/mob-sakai/UIEffect/commit/3f5a7dcd2d8248b9e47fb9d38c083f26b798e063)), closes [#310](https://github.com/mob-sakai/UIEffect/issues/310)
|
||||
* `TransitionFilter` and `GradationMode` do not work correctly when the initial scale is 0 ([bdbf293](https://github.com/mob-sakai/UIEffect/commit/bdbf293c1489c0b248078969b37ec66890620d44)), closes [#311](https://github.com/mob-sakai/UIEffect/issues/311)
|
||||
* component icons will no longer be displayed in the scene view (Unity 2021.2 or later) ([40ff828](https://github.com/mob-sakai/UIEffect/commit/40ff828ff0697dc8f6597cfcf094cc63532a19dd))
|
||||
* fix potential issues ([a748adf](https://github.com/mob-sakai/UIEffect/commit/a748adf1bde5e400fcc84ec902a1438867105f75))
|
||||
* reset time button does not work correctly in the inspector when `UIEffectTweener.direction=Reverse` in the editor ([8513970](https://github.com/mob-sakai/UIEffect/commit/8513970e6f71d393430a573bfb0207428998bee1)), closes [#310](https://github.com/mob-sakai/UIEffect/issues/310)
|
||||
|
||||
## [5.5.1](https://github.com/mob-sakai/UIEffect/compare/5.5.0...5.5.1) (2025-02-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fix v4 compatible components ([6f6a8c9](https://github.com/mob-sakai/UIEffect/commit/6f6a8c95f878a290b1c4238cd0519f14febc04b6))
|
||||
* fully visible when the transition rate is set to 1 ([0a99bb7](https://github.com/mob-sakai/UIEffect/commit/0a99bb7765443a84070e19c9ea0096808442932e)), closes [#309](https://github.com/mob-sakai/UIEffect/issues/309)
|
||||
* UIEffect with TextMeshPro appears black in the editor when saving scene ([8cbcd76](https://github.com/mob-sakai/UIEffect/commit/8cbcd765ed9e11c38e3257191c2fc7dcd2c9916e))
|
||||
|
||||
# [5.5.0](https://github.com/mob-sakai/UIEffect/compare/5.4.0...5.5.0) (2025-02-12)
|
||||
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace Coffee.UIEffects.Editors
|
||||
var rResetTimeButton = new Rect(r.x, r.y, 20, r.height);
|
||||
if (GUI.Button(rResetTimeButton, EditorGUIUtility.IconContent("animation.firstkey"), "IconButton"))
|
||||
{
|
||||
SetTime(0);
|
||||
ResetTime();
|
||||
}
|
||||
|
||||
var rPlayButton = new Rect(r.x + 20, r.y, 20, r.height);
|
||||
@@ -149,6 +149,14 @@ namespace Coffee.UIEffects.Editors
|
||||
}
|
||||
}
|
||||
|
||||
private void ResetTime()
|
||||
{
|
||||
foreach (var tweener in targets.OfType<UIEffectTweener>())
|
||||
{
|
||||
tweener.ResetTime(tweener.direction);
|
||||
}
|
||||
}
|
||||
|
||||
private void SetPlaying(bool enable)
|
||||
{
|
||||
if (!EditorApplication.isPlaying)
|
||||
|
||||
Binary file not shown.
@@ -204,7 +204,7 @@ namespace Coffee.UIEffectInternal
|
||||
target.enabled = false;
|
||||
|
||||
// Find MonoScript of the specified component.
|
||||
foreach (var script in Resources.FindObjectsOfTypeAll<MonoScript>())
|
||||
foreach (var script in MonoImporter.GetAllRuntimeMonoScripts())
|
||||
{
|
||||
if (script.GetClass() != typeof(T))
|
||||
{
|
||||
|
||||
@@ -3,11 +3,16 @@ using System.Diagnostics;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using Object = UnityEngine.Object;
|
||||
#if UNITY_EDITOR && UNITY_2021_2_OR_NEWER
|
||||
#if UNITY_EDITOR
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
#if UNITY_2021_2_OR_NEWER
|
||||
using UnityEditor.SceneManagement;
|
||||
#elif UNITY_EDITOR
|
||||
#else
|
||||
using UnityEditor.Experimental.SceneManagement;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace Coffee.UIEffectInternal
|
||||
{
|
||||
@@ -72,5 +77,56 @@ namespace Coffee.UIEffectInternal
|
||||
|
||||
public static bool isBatchOrBuilding => Application.isBatchMode || BuildPipeline.isBuildingPlayer;
|
||||
#endif
|
||||
|
||||
[Conditional("UNITY_EDITOR")]
|
||||
public static void QueuePlayerLoopUpdate()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
if (!EditorApplication.isPlaying)
|
||||
{
|
||||
EditorApplication.QueuePlayerLoopUpdate();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#if !UNITY_2021_2_OR_NEWER
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
[Conditional("UNITY_EDITOR")]
|
||||
internal class IconAttribute : Attribute
|
||||
{
|
||||
private readonly string _path;
|
||||
|
||||
public IconAttribute(string path)
|
||||
{
|
||||
_path = path;
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
private static Action<Object, Texture2D> s_SetIconForObject = typeof(EditorGUIUtility)
|
||||
.GetMethod("SetIconForObject", BindingFlags.Static | BindingFlags.NonPublic)
|
||||
.CreateDelegate(typeof(Action<Object, Texture2D>), null) as Action<Object, Texture2D>;
|
||||
|
||||
[InitializeOnLoadMethod]
|
||||
private static void InitializeOnLoadMethod()
|
||||
{
|
||||
if (Misc.isBatchOrBuilding) return;
|
||||
|
||||
var types = TypeCache.GetTypesWithAttribute<IconAttribute>();
|
||||
var scripts = MonoImporter.GetAllRuntimeMonoScripts();
|
||||
foreach (var type in types)
|
||||
{
|
||||
var script = scripts.FirstOrDefault(x => x.GetClass() == type);
|
||||
if (!script) continue;
|
||||
|
||||
var path = type.GetCustomAttribute<IconAttribute>()?._path;
|
||||
var icon = AssetDatabase.LoadAssetAtPath<Texture2D>(path);
|
||||
if (!icon) continue;
|
||||
|
||||
s_SetIconForObject(script, icon);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Coffee.UIEffectInternal
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Field)]
|
||||
[Conditional("UNITY_EDITOR")]
|
||||
public sealed class PowerRangeAttribute : PropertyAttribute
|
||||
{
|
||||
public readonly float min;
|
||||
|
||||
@@ -5,6 +5,7 @@ using UnityEngine.Rendering;
|
||||
|
||||
namespace Coffee.UIEffects
|
||||
{
|
||||
[Icon("Packages/com.coffee.ui-effect/Editor/UIEffectIconIcon.png")]
|
||||
[ExecuteAlways]
|
||||
[DisallowMultipleComponent]
|
||||
public class UIEffect : UIEffectBase
|
||||
@@ -1060,13 +1061,13 @@ namespace Coffee.UIEffects
|
||||
c.gradationRotation = m_GradationRotation;
|
||||
}
|
||||
|
||||
public override void ApplyContextToMaterial()
|
||||
public override void ApplyContextToMaterial(Material material)
|
||||
{
|
||||
base.ApplyContextToMaterial();
|
||||
base.ApplyContextToMaterial(material);
|
||||
replicas.ForEach(c =>
|
||||
{
|
||||
if (!c) return;
|
||||
c.ApplyContextToMaterial();
|
||||
c.ApplyContextToMaterial(material);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 5b93acc4527c740459bbfbd3404191be, type: 3}
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Coffee.UIEffectInternal;
|
||||
using UnityEngine;
|
||||
@@ -21,6 +22,7 @@ namespace Coffee.UIEffects
|
||||
private Graphic _graphic;
|
||||
private Material _material;
|
||||
private UIEffectContext _context;
|
||||
private Action _setVerticesDirtyIfVisible;
|
||||
|
||||
public Graphic graphic => _graphic ? _graphic : _graphic = GetComponent<Graphic>();
|
||||
public virtual uint effectId => (uint)GetInstanceID();
|
||||
@@ -52,6 +54,11 @@ namespace Coffee.UIEffects
|
||||
|
||||
protected override void OnDisable()
|
||||
{
|
||||
if (_setVerticesDirtyIfVisible != null)
|
||||
{
|
||||
UIExtraCallbacks.onBeforeCanvasRebuild -= _setVerticesDirtyIfVisible;
|
||||
}
|
||||
|
||||
MaterialRepository.Release(ref _material);
|
||||
SetMaterialDirty();
|
||||
SetVerticesDirty();
|
||||
@@ -59,6 +66,8 @@ namespace Coffee.UIEffects
|
||||
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
_setVerticesDirtyIfVisible = null;
|
||||
_graphic = null;
|
||||
s_ContextPool.Return(ref _context);
|
||||
}
|
||||
|
||||
@@ -70,7 +79,27 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
if (!isActiveAndEnabled || context == null) return;
|
||||
|
||||
context.ModifyMesh(graphic, transitionRoot, vh, canModifyShape);
|
||||
if (CanModifyMesh())
|
||||
{
|
||||
context.ModifyMesh(graphic, transitionRoot, vh, canModifyShape);
|
||||
}
|
||||
// If you can't modify the mesh, retry next frame.
|
||||
else
|
||||
{
|
||||
UIExtraCallbacks.onBeforeCanvasRebuild += _setVerticesDirtyIfVisible ??= SetVerticesDirtyIfVisible;
|
||||
}
|
||||
}
|
||||
|
||||
private bool CanModifyMesh()
|
||||
{
|
||||
// The transitionRoot is same as the transform => true.
|
||||
var root = transitionRoot;
|
||||
if (transform == root) return true;
|
||||
|
||||
// The transitionRoot is not visible => false.
|
||||
var scale1 = root.lossyScale;
|
||||
var scale2 = transform.lossyScale;
|
||||
return !Mathf.Approximately(scale1.x * scale1.y * scale2.x * scale2.y, 0);
|
||||
}
|
||||
|
||||
public virtual Material GetModifiedMaterial(Material baseMaterial)
|
||||
@@ -98,7 +127,7 @@ namespace Coffee.UIEffects
|
||||
Profiler.EndSample();
|
||||
}
|
||||
|
||||
ApplyContextToMaterial();
|
||||
ApplyContextToMaterial(_material);
|
||||
Profiler.EndSample();
|
||||
return _material;
|
||||
}
|
||||
@@ -107,14 +136,8 @@ namespace Coffee.UIEffects
|
||||
protected override void OnValidate()
|
||||
{
|
||||
UpdateContext(context);
|
||||
ApplyContextToMaterial();
|
||||
SetVerticesDirty();
|
||||
SetMaterialDirty();
|
||||
|
||||
if (!EditorApplication.isPlaying)
|
||||
{
|
||||
EditorApplication.QueuePlayerLoopUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Reset()
|
||||
@@ -141,13 +164,22 @@ namespace Coffee.UIEffects
|
||||
if (graphic)
|
||||
{
|
||||
graphic.SetVerticesDirty();
|
||||
GraphicProxy.Find(graphic).SetVerticesDirty(graphic);
|
||||
GraphicProxy.Find(graphic).SetVerticesDirty(graphic, enabled);
|
||||
#if UNITY_EDITOR
|
||||
EditorApplication.QueuePlayerLoopUpdate();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
private void SetVerticesDirtyIfVisible()
|
||||
{
|
||||
if (CanModifyMesh())
|
||||
{
|
||||
UIExtraCallbacks.onBeforeCanvasRebuild -= _setVerticesDirtyIfVisible ??= SetVerticesDirtyIfVisible;
|
||||
SetVerticesDirty();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void SetMaterialDirty()
|
||||
{
|
||||
if (graphic)
|
||||
@@ -161,14 +193,14 @@ namespace Coffee.UIEffects
|
||||
|
||||
protected abstract void UpdateContext(UIEffectContext c);
|
||||
|
||||
public virtual void ApplyContextToMaterial()
|
||||
public virtual void ApplyContextToMaterial(Material material)
|
||||
{
|
||||
if (!isActiveAndEnabled || context == null) return;
|
||||
if (!isActiveAndEnabled || context == null || !material) return;
|
||||
|
||||
context.ApplyToMaterial(_material, actualSamplingScale);
|
||||
context.ApplyToMaterial(material, actualSamplingScale);
|
||||
|
||||
#if UNITY_EDITOR
|
||||
UIEffectProjectSettings.shaderRegistry.RegisterVariant(_material, "UI > UIEffect");
|
||||
UIEffectProjectSettings.shaderRegistry.RegisterVariant(material, "UI > UIEffect");
|
||||
if (!EditorApplication.isPlaying)
|
||||
{
|
||||
EditorApplication.QueuePlayerLoopUpdate();
|
||||
|
||||
@@ -447,7 +447,7 @@ namespace Coffee.UIEffects
|
||||
effectProxy.OnPreModifyMesh(graphic);
|
||||
|
||||
var verts = s_WorkingVertices;
|
||||
var expandSize = GetExpandSize(canModifyShape);
|
||||
var expandSize = effectProxy.ModifyExpandSize(graphic, GetExpandSize(canModifyShape));
|
||||
var count = vh.currentIndexCount;
|
||||
|
||||
// Get the rectangle to calculate the normalized position.
|
||||
@@ -462,8 +462,12 @@ namespace Coffee.UIEffects
|
||||
if (transitionRoot)
|
||||
{
|
||||
rect = transitionRoot.rect;
|
||||
rectMatrix = transitionRoot.worldToLocalMatrix
|
||||
* graphic.transform.localToWorldMatrix;
|
||||
if (transitionRoot != graphic.transform)
|
||||
{
|
||||
rectMatrix = transitionRoot.worldToLocalMatrix
|
||||
* graphic.transform.localToWorldMatrix;
|
||||
}
|
||||
|
||||
rot *= Matrix4x4.Scale(new Vector3(1 / multiplier, 1 / multiplier, 1))
|
||||
* rectMatrix;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ using UnityEngine;
|
||||
|
||||
namespace Coffee.UIEffects
|
||||
{
|
||||
[Icon("Packages/com.coffee.ui-effect/Editor/UIEffectIconIcon.png")]
|
||||
public class UIEffectProjectSettings : PreloadedProjectSettings<UIEffectProjectSettings>
|
||||
{
|
||||
[Tooltip(
|
||||
|
||||
@@ -5,7 +5,7 @@ MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 5b93acc4527c740459bbfbd3404191be, type: 3}
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@@ -3,6 +3,7 @@ using UnityEngine;
|
||||
|
||||
namespace Coffee.UIEffects
|
||||
{
|
||||
[Icon("Packages/com.coffee.ui-effect/Editor/UIEffectIconIcon.png")]
|
||||
public class UIEffectReplica : UIEffectBase
|
||||
{
|
||||
[SerializeField] private UIEffect m_Target;
|
||||
@@ -107,11 +108,11 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
}
|
||||
|
||||
public override void ApplyContextToMaterial()
|
||||
public override void ApplyContextToMaterial(Material material)
|
||||
{
|
||||
if (!isActiveAndEnabled || !target || !target.isActiveAndEnabled) return;
|
||||
|
||||
base.ApplyContextToMaterial();
|
||||
base.ApplyContextToMaterial(material);
|
||||
}
|
||||
|
||||
public override void SetRate(float rate, UIEffectTweener.CullingMask mask)
|
||||
|
||||
@@ -5,7 +5,7 @@ MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 5b93acc4527c740459bbfbd3404191be, type: 3}
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
using System;
|
||||
using Coffee.UIEffectInternal;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
namespace Coffee.UIEffects
|
||||
{
|
||||
[Icon("Packages/com.coffee.ui-effect/Editor/UIEffectIconIcon.png")]
|
||||
[ExecuteAlways]
|
||||
[RequireComponent(typeof(UIEffectBase))]
|
||||
public class UIEffectTweener : MonoBehaviour
|
||||
@@ -343,7 +345,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
if (resetTime)
|
||||
{
|
||||
ResetTime();
|
||||
ResetTime(direction);
|
||||
}
|
||||
|
||||
Play();
|
||||
@@ -363,7 +365,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
if (resetTime)
|
||||
{
|
||||
ResetTime();
|
||||
ResetTime(Direction.Forward);
|
||||
}
|
||||
|
||||
PlayForward();
|
||||
@@ -384,7 +386,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
if (resetTime)
|
||||
{
|
||||
ResetTime();
|
||||
ResetTime(Direction.Reverse);
|
||||
}
|
||||
|
||||
PlayReverse();
|
||||
@@ -417,6 +419,18 @@ namespace Coffee.UIEffects
|
||||
SetTime(0);
|
||||
}
|
||||
|
||||
public void ResetTime(Direction dir)
|
||||
{
|
||||
if (dir == Direction.Forward)
|
||||
{
|
||||
SetTime(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetTime(totalTime - 0.0001f);
|
||||
}
|
||||
}
|
||||
|
||||
[Obsolete(
|
||||
"UIEffectTweener.Restart has been deprecated. Use UIEffectTweener.ResetTime instead (UnityUpgradable) -> ResetTime")]
|
||||
public void Restart()
|
||||
|
||||
@@ -5,7 +5,7 @@ MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {fileID: 2800000, guid: 5b93acc4527c740459bbfbd3404191be, type: 3}
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@@ -68,10 +68,15 @@ namespace Coffee.UIEffects
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void SetVerticesDirty(Graphic graphic)
|
||||
public virtual void SetVerticesDirty(Graphic graphic, bool enabled)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual Vector4 ModifyExpandSize(Graphic graphic, Vector2 expandSize)
|
||||
{
|
||||
return new Vector4(expandSize.x, expandSize.y, expandSize.x, expandSize.y);
|
||||
}
|
||||
|
||||
private static readonly Func<UIVertex, UIVertex, UIVertex, float, UIVertex> s_OnLerpVertex =
|
||||
null;
|
||||
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Coffee.UIEffects
|
||||
{
|
||||
internal class ImageProxy : GraphicProxy
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
[InitializeOnLoadMethod]
|
||||
#endif
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
|
||||
private static void InitializeOnLoad()
|
||||
{
|
||||
Register(new ImageProxy());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if the graphic is valid for this proxy.
|
||||
/// </summary>
|
||||
protected override bool IsValid(Graphic graphic)
|
||||
{
|
||||
if (!graphic) return false;
|
||||
if (graphic is Image) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if the graphic is a text.
|
||||
/// </summary>
|
||||
public override bool IsText(Graphic graphic)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override Vector4 ModifyExpandSize(Graphic graphic, Vector2 expandSize)
|
||||
{
|
||||
var image = graphic as Image;
|
||||
var ret = new Vector4(expandSize.x, expandSize.y, expandSize.x, expandSize.y);
|
||||
|
||||
if (image
|
||||
&& image.type == Image.Type.Filled
|
||||
&& image.fillMethod == Image.FillMethod.Radial360
|
||||
&& image.fillAmount <= 0.5f)
|
||||
{
|
||||
ret[(image.fillOrigin + (image.fillClockwise ? 2 : 0)) % 4] = 0;
|
||||
|
||||
if (image.fillAmount <= 0.25f)
|
||||
{
|
||||
ret[(image.fillOrigin + 3) % 4] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cddfadaf298c14befb49972983c16f2d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -53,11 +53,19 @@ namespace Coffee.UIEffects
|
||||
}
|
||||
}
|
||||
|
||||
public override void SetVerticesDirty(Graphic graphic)
|
||||
public override void SetVerticesDirty(Graphic graphic, bool enabled)
|
||||
{
|
||||
if (graphic is TextMeshProUGUI textMeshProUGUI && textMeshProUGUI.isActiveAndEnabled)
|
||||
{
|
||||
OnChangeText(textMeshProUGUI);
|
||||
if (enabled)
|
||||
{
|
||||
OnChangeText(textMeshProUGUI);
|
||||
}
|
||||
else if (0 < textMeshProUGUI.textInfo?.meshInfo?.Length
|
||||
&& 0 < textMeshProUGUI.textInfo.meshInfo[0].vertexCount)
|
||||
{
|
||||
textMeshProUGUI.UpdateVertexData();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,6 +182,20 @@ namespace Coffee.UIEffects
|
||||
|
||||
s_ChangedInstances.Clear();
|
||||
};
|
||||
|
||||
#if UNITY_EDITOR
|
||||
UnityEditor.SceneManagement.EditorSceneManager.sceneSaved += _ =>
|
||||
{
|
||||
foreach (var textMeshProUGUI in s_RegisteredInstances)
|
||||
{
|
||||
if (!textMeshProUGUI || !textMeshProUGUI.isActiveAndEnabled) continue;
|
||||
if (textMeshProUGUI.TryGetComponent<UIEffect>(out var effect) && effect.isActiveAndEnabled)
|
||||
{
|
||||
effect.SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
};
|
||||
#endif
|
||||
}
|
||||
|
||||
private static void OnChangeText(Object obj)
|
||||
@@ -236,7 +258,6 @@ namespace Coffee.UIEffects
|
||||
}
|
||||
|
||||
s_VertexHelper.FillMesh(s_Mesh);
|
||||
replica.ApplyContextToMaterial();
|
||||
subMeshUI.canvasRenderer.SetMesh(s_Mesh);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -18,56 +18,62 @@ namespace Coffee.UIEffects
|
||||
}
|
||||
}
|
||||
|
||||
public static void Expand(List<UIVertex> verts, int start, int bundleSize, Vector2 expandSize, Rect bounds)
|
||||
public static void Expand(List<UIVertex> verts, int start, int bundleSize, Vector4 expandSize, Rect bounds)
|
||||
{
|
||||
if (expandSize == Vector2.zero) return;
|
||||
if (expandSize == Vector4.zero) return;
|
||||
|
||||
// Quad (6 vertices)
|
||||
for (var j = 0; j < bundleSize; j += 6)
|
||||
for (var j = 0; j < bundleSize; j += 3)
|
||||
{
|
||||
var size = default(Vector3);
|
||||
var extendPos = default(Vector3);
|
||||
var extendUV = default(Vector3);
|
||||
var posLB = verts[start + j + 1].position;
|
||||
var posRT = verts[start + j + 4].position;
|
||||
var willExpand = bundleSize == 6 // Text or simple quad
|
||||
|| !bounds.Contains(posLB)
|
||||
|| !bounds.Contains(posRT); // Outer 9-sliced quad
|
||||
if (willExpand)
|
||||
if (bounds.Contains(verts[start + j + 0].position)
|
||||
&& bounds.Contains(verts[start + j + 1].position)
|
||||
&& bounds.Contains(verts[start + j + 2].position))
|
||||
{
|
||||
var uvLB = verts[start + j + 1].uv0;
|
||||
var uvRT = verts[start + j + 4].uv0;
|
||||
var posCenter = (posLB + posRT) / 2;
|
||||
var uvCenter = (uvLB + uvRT) / 2;
|
||||
size = posLB - posRT;
|
||||
size.x = 1 + expandSize.x / Mathf.Abs(size.x);
|
||||
size.y = 1 + expandSize.y / Mathf.Abs(size.y);
|
||||
size.z = 1;
|
||||
extendPos = posCenter - Vector3.Scale(size, posCenter);
|
||||
extendUV = uvCenter - Vector4.Scale(size, uvCenter);
|
||||
continue;
|
||||
}
|
||||
|
||||
GetBounds(verts, start + j, 3, out var posBounds, out var uvBounds);
|
||||
var posCenter = (Vector4)posBounds.center;
|
||||
posCenter.z = posCenter.x;
|
||||
posCenter.w = posCenter.y;
|
||||
var uvCenter = (Vector4)uvBounds.center;
|
||||
uvCenter.z = uvCenter.x;
|
||||
uvCenter.w = uvCenter.y;
|
||||
var size = (Vector4)posBounds.size;
|
||||
size.z = 1 + expandSize.z / Mathf.Abs(size.x);
|
||||
size.w = 1 + expandSize.w / Mathf.Abs(size.y);
|
||||
size.x = 1 + expandSize.x / Mathf.Abs(size.x);
|
||||
size.y = 1 + expandSize.y / Mathf.Abs(size.y);
|
||||
var extendPos = posCenter - Vector4.Scale(size, posCenter);
|
||||
var extendUV = uvCenter - Vector4.Scale(size, uvCenter);
|
||||
|
||||
// Set vertex position, uv, uvMask and local normalized position.
|
||||
for (var k = 0; k < 6; k++)
|
||||
for (var k = 0; k < 3; k++)
|
||||
{
|
||||
var vt = verts[start + j + k];
|
||||
var pos = vt.position;
|
||||
var uv0 = vt.uv0;
|
||||
|
||||
// Expand edge vertex
|
||||
if (willExpand)
|
||||
if (pos.x < bounds.xMin)
|
||||
{
|
||||
if (pos.x < bounds.xMin || bounds.xMax < pos.x)
|
||||
{
|
||||
pos.x = pos.x * size.x + extendPos.x;
|
||||
uv0.x = uv0.x * size.x + extendUV.x;
|
||||
}
|
||||
pos.x = pos.x * size.x + extendPos.x;
|
||||
uv0.x = uv0.x * size.x + extendUV.x;
|
||||
}
|
||||
else if (bounds.xMax < pos.x)
|
||||
{
|
||||
pos.x = pos.x * size.z + extendPos.z;
|
||||
uv0.x = uv0.x * size.z + extendUV.z;
|
||||
}
|
||||
|
||||
if (pos.y < bounds.yMin || bounds.yMax < pos.y)
|
||||
{
|
||||
pos.y = pos.y * size.y + extendPos.y;
|
||||
uv0.y = uv0.y * size.y + extendUV.y;
|
||||
}
|
||||
if (pos.y < bounds.yMin)
|
||||
{
|
||||
pos.y = pos.y * size.y + extendPos.y;
|
||||
uv0.y = uv0.y * size.y + extendUV.y;
|
||||
}
|
||||
else if (bounds.yMax < pos.y)
|
||||
{
|
||||
pos.y = pos.y * size.w + extendPos.w;
|
||||
uv0.y = uv0.y * size.w + extendUV.w;
|
||||
}
|
||||
|
||||
vt.position = pos;
|
||||
|
||||
@@ -261,6 +261,8 @@ MonoBehaviour:
|
||||
m_GradationMode: 0
|
||||
m_GradationColor1: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor2: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor3: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor4: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationGradient:
|
||||
serializedVersion: 2
|
||||
key0: {r: 1, g: 1, b: 1, a: 1}
|
||||
@@ -298,6 +300,7 @@ MonoBehaviour:
|
||||
m_EdgeWidth: 0.5
|
||||
m_EdgeColorFilter: 4
|
||||
m_EdgeColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_EdgeShinyRate: 0.5
|
||||
m_EdgeShinyWidth: 0.5
|
||||
m_EdgeShinyAutoPlaySpeed: 1
|
||||
m_PatternArea: 1
|
||||
@@ -506,6 +509,8 @@ MonoBehaviour:
|
||||
m_GradationMode: 0
|
||||
m_GradationColor1: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor2: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor3: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor4: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationGradient:
|
||||
serializedVersion: 2
|
||||
key0: {r: 1, g: 1, b: 1, a: 1}
|
||||
@@ -543,6 +548,7 @@ MonoBehaviour:
|
||||
m_EdgeWidth: 0.5
|
||||
m_EdgeColorFilter: 4
|
||||
m_EdgeColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_EdgeShinyRate: 0.5
|
||||
m_EdgeShinyWidth: 0.5
|
||||
m_EdgeShinyAutoPlaySpeed: 1
|
||||
m_PatternArea: 1
|
||||
@@ -746,6 +752,8 @@ MonoBehaviour:
|
||||
m_GradationMode: 0
|
||||
m_GradationColor1: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor2: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor3: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor4: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationGradient:
|
||||
serializedVersion: 2
|
||||
key0: {r: 1, g: 1, b: 1, a: 1}
|
||||
@@ -783,6 +791,7 @@ MonoBehaviour:
|
||||
m_EdgeWidth: 0.5
|
||||
m_EdgeColorFilter: 4
|
||||
m_EdgeColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_EdgeShinyRate: 0.5
|
||||
m_EdgeShinyWidth: 0.5
|
||||
m_EdgeShinyAutoPlaySpeed: 1
|
||||
m_PatternArea: 1
|
||||
@@ -918,7 +927,7 @@ MonoBehaviour:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 413777962}
|
||||
m_Enabled: 1
|
||||
m_Enabled: 0
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: bcd162ab5f95d4f82a841acc1e950418, type: 3}
|
||||
m_Name:
|
||||
@@ -1273,6 +1282,8 @@ MonoBehaviour:
|
||||
m_GradationMode: 0
|
||||
m_GradationColor1: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor2: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor3: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor4: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationGradient:
|
||||
serializedVersion: 2
|
||||
key0: {r: 1, g: 1, b: 1, a: 1}
|
||||
@@ -1310,6 +1321,7 @@ MonoBehaviour:
|
||||
m_EdgeWidth: 0.5
|
||||
m_EdgeColorFilter: 4
|
||||
m_EdgeColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_EdgeShinyRate: 0.5
|
||||
m_EdgeShinyWidth: 0.5
|
||||
m_EdgeShinyAutoPlaySpeed: 1
|
||||
m_PatternArea: 1
|
||||
@@ -1453,6 +1465,8 @@ MonoBehaviour:
|
||||
m_GradationMode: 0
|
||||
m_GradationColor1: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor2: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor3: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor4: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationGradient:
|
||||
serializedVersion: 2
|
||||
key0: {r: 1, g: 1, b: 1, a: 1}
|
||||
@@ -1490,6 +1504,7 @@ MonoBehaviour:
|
||||
m_EdgeWidth: 0.5
|
||||
m_EdgeColorFilter: 4
|
||||
m_EdgeColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_EdgeShinyRate: 0.5
|
||||
m_EdgeShinyWidth: 0.5
|
||||
m_EdgeShinyAutoPlaySpeed: 1
|
||||
m_PatternArea: 1
|
||||
@@ -1749,6 +1764,8 @@ MonoBehaviour:
|
||||
m_GradationMode: 2
|
||||
m_GradationColor1: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor2: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor3: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor4: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationGradient:
|
||||
serializedVersion: 2
|
||||
key0: {r: 1, g: 0, b: 0, a: 1}
|
||||
@@ -1786,6 +1803,7 @@ MonoBehaviour:
|
||||
m_EdgeWidth: 0.5
|
||||
m_EdgeColorFilter: 4
|
||||
m_EdgeColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_EdgeShinyRate: 0.5
|
||||
m_EdgeShinyWidth: 0.5
|
||||
m_EdgeShinyAutoPlaySpeed: 1
|
||||
m_PatternArea: 1
|
||||
@@ -1926,6 +1944,8 @@ MonoBehaviour:
|
||||
m_GradationMode: 0
|
||||
m_GradationColor1: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor2: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor3: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor4: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationGradient:
|
||||
serializedVersion: 2
|
||||
key0: {r: 1, g: 1, b: 1, a: 1}
|
||||
@@ -1963,6 +1983,7 @@ MonoBehaviour:
|
||||
m_EdgeWidth: 0.5
|
||||
m_EdgeColorFilter: 4
|
||||
m_EdgeColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_EdgeShinyRate: 0.5
|
||||
m_EdgeShinyWidth: 0.5
|
||||
m_EdgeShinyAutoPlaySpeed: 1
|
||||
m_PatternArea: 1
|
||||
@@ -2623,6 +2644,8 @@ MonoBehaviour:
|
||||
m_GradationMode: 0
|
||||
m_GradationColor1: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor2: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor3: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor4: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationGradient:
|
||||
serializedVersion: 2
|
||||
key0: {r: 1, g: 1, b: 1, a: 1}
|
||||
@@ -2660,6 +2683,7 @@ MonoBehaviour:
|
||||
m_EdgeWidth: 0.5
|
||||
m_EdgeColorFilter: 4
|
||||
m_EdgeColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_EdgeShinyRate: 0.5
|
||||
m_EdgeShinyWidth: 0.5
|
||||
m_EdgeShinyAutoPlaySpeed: 1
|
||||
m_PatternArea: 1
|
||||
@@ -2897,6 +2921,8 @@ MonoBehaviour:
|
||||
m_GradationMode: 2
|
||||
m_GradationColor1: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor2: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor3: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor4: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationGradient:
|
||||
serializedVersion: 2
|
||||
key0: {r: 1, g: 0, b: 0, a: 1}
|
||||
@@ -2934,6 +2960,7 @@ MonoBehaviour:
|
||||
m_EdgeWidth: 0.5
|
||||
m_EdgeColorFilter: 4
|
||||
m_EdgeColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_EdgeShinyRate: 0.5
|
||||
m_EdgeShinyWidth: 0.5
|
||||
m_EdgeShinyAutoPlaySpeed: 1
|
||||
m_PatternArea: 1
|
||||
@@ -3507,6 +3534,8 @@ MonoBehaviour:
|
||||
m_GradationMode: 0
|
||||
m_GradationColor1: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor2: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor3: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor4: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationGradient:
|
||||
serializedVersion: 2
|
||||
key0: {r: 1, g: 1, b: 1, a: 1}
|
||||
@@ -3544,6 +3573,7 @@ MonoBehaviour:
|
||||
m_EdgeWidth: 0.5
|
||||
m_EdgeColorFilter: 4
|
||||
m_EdgeColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_EdgeShinyRate: 0.5
|
||||
m_EdgeShinyWidth: 0.5
|
||||
m_EdgeShinyAutoPlaySpeed: 1
|
||||
m_PatternArea: 1
|
||||
@@ -3912,6 +3942,8 @@ MonoBehaviour:
|
||||
m_GradationMode: 0
|
||||
m_GradationColor1: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor2: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor3: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor4: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationGradient:
|
||||
serializedVersion: 2
|
||||
key0: {r: 1, g: 1, b: 1, a: 1}
|
||||
@@ -3949,6 +3981,7 @@ MonoBehaviour:
|
||||
m_EdgeWidth: 0.5
|
||||
m_EdgeColorFilter: 4
|
||||
m_EdgeColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_EdgeShinyRate: 0.5
|
||||
m_EdgeShinyWidth: 0.5
|
||||
m_EdgeShinyAutoPlaySpeed: 1
|
||||
m_PatternArea: 1
|
||||
@@ -4229,6 +4262,8 @@ MonoBehaviour:
|
||||
m_GradationMode: 0
|
||||
m_GradationColor1: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor2: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor3: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor4: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationGradient:
|
||||
serializedVersion: 2
|
||||
key0: {r: 1, g: 1, b: 1, a: 1}
|
||||
@@ -4266,6 +4301,7 @@ MonoBehaviour:
|
||||
m_EdgeWidth: 0.5
|
||||
m_EdgeColorFilter: 4
|
||||
m_EdgeColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_EdgeShinyRate: 0.5
|
||||
m_EdgeShinyWidth: 0.5
|
||||
m_EdgeShinyAutoPlaySpeed: 1
|
||||
m_PatternArea: 1
|
||||
@@ -4540,6 +4576,8 @@ MonoBehaviour:
|
||||
m_GradationMode: 0
|
||||
m_GradationColor1: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor2: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor3: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor4: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationGradient:
|
||||
serializedVersion: 2
|
||||
key0: {r: 1, g: 1, b: 1, a: 1}
|
||||
@@ -4577,6 +4615,7 @@ MonoBehaviour:
|
||||
m_EdgeWidth: 0.5
|
||||
m_EdgeColorFilter: 4
|
||||
m_EdgeColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_EdgeShinyRate: 0.5
|
||||
m_EdgeShinyWidth: 0.5
|
||||
m_EdgeShinyAutoPlaySpeed: 1
|
||||
m_PatternArea: 1
|
||||
@@ -4865,7 +4904,7 @@ MonoBehaviour:
|
||||
m_HandleRect: {fileID: 1947276361}
|
||||
m_Direction: 2
|
||||
m_Value: 1
|
||||
m_Size: 0.5139664
|
||||
m_Size: 0.73004
|
||||
m_NumberOfSteps: 0
|
||||
m_OnValueChanged:
|
||||
m_PersistentCalls:
|
||||
@@ -5237,6 +5276,8 @@ MonoBehaviour:
|
||||
m_GradationMode: 0
|
||||
m_GradationColor1: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor2: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor3: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor4: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationGradient:
|
||||
serializedVersion: 2
|
||||
key0: {r: 1, g: 1, b: 1, a: 1}
|
||||
@@ -5274,6 +5315,7 @@ MonoBehaviour:
|
||||
m_EdgeWidth: 0.5
|
||||
m_EdgeColorFilter: 4
|
||||
m_EdgeColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_EdgeShinyRate: 0.5
|
||||
m_EdgeShinyWidth: 0.5
|
||||
m_EdgeShinyAutoPlaySpeed: 1
|
||||
m_PatternArea: 1
|
||||
@@ -5618,6 +5660,8 @@ MonoBehaviour:
|
||||
m_GradationMode: 0
|
||||
m_GradationColor1: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor2: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor3: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationColor4: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_GradationGradient:
|
||||
serializedVersion: 2
|
||||
key0: {r: 1, g: 1, b: 1, a: 1}
|
||||
@@ -5655,6 +5699,7 @@ MonoBehaviour:
|
||||
m_EdgeWidth: 0.5
|
||||
m_EdgeColorFilter: 4
|
||||
m_EdgeColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_EdgeShinyRate: 0.5
|
||||
m_EdgeShinyWidth: 0.5
|
||||
m_EdgeShinyAutoPlaySpeed: 1
|
||||
m_PatternArea: 1
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
m_EffectFactor = value;
|
||||
UpdateContext(context);
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
m_Width = value;
|
||||
UpdateContext(context);
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
m_Softness = value;
|
||||
UpdateContext(context);
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
m_Color = value;
|
||||
UpdateContext(context);
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace Coffee.UIEffects
|
||||
m_TransitionTexture = value;
|
||||
UpdateContext(context);
|
||||
SetVerticesDirty();
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
m_ColorMode = value;
|
||||
UpdateContext(context);
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
m_EffectFactor = value;
|
||||
UpdateContext(context);
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
m_ColorFactor = value;
|
||||
UpdateContext(context);
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
m_BlurFactor = value;
|
||||
UpdateContext(context);
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace Coffee.UIEffects
|
||||
m_EffectMode = value;
|
||||
UpdateContext(context);
|
||||
SetVerticesDirty();
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
m_ColorMode = value;
|
||||
UpdateContext(context);
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
UpdateContext(context);
|
||||
SetVerticesDirty();
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
m_TargetColor = value;
|
||||
UpdateContext(context);
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
m_Range = value;
|
||||
UpdateContext(context);
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
m_Saturation = value;
|
||||
UpdateContext(context);
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
m_Value = value;
|
||||
UpdateContext(context);
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
m_Hue = value;
|
||||
UpdateContext(context);
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
m_EffectFactor = value;
|
||||
UpdateContext(context);
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
m_Width = value;
|
||||
UpdateContext(context);
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
m_Softness = value;
|
||||
UpdateContext(context);
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
m_Brightness = value;
|
||||
UpdateContext(context);
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
m_Gloss = value;
|
||||
UpdateContext(context);
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
m_EffectFactor = value;
|
||||
UpdateContext(context);
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace Coffee.UIEffects
|
||||
m_TransitionTexture = value;
|
||||
UpdateContext(context);
|
||||
SetVerticesDirty();
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
m_EffectMode = value;
|
||||
UpdateContext(context);
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
m_DissolveWidth = value;
|
||||
UpdateContext(context);
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
m_DissolveSoftness = value;
|
||||
UpdateContext(context);
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
m_DissolveColor = value;
|
||||
UpdateContext(context);
|
||||
ApplyContextToMaterial();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ float2 texel_size()
|
||||
|
||||
float transition_rate()
|
||||
{
|
||||
return frac(_TransitionAutoPlaySpeed * _Time.y + _TransitionRate);
|
||||
return frac(_TransitionAutoPlaySpeed * _Time.y + _TransitionRate * 0.9999);
|
||||
}
|
||||
|
||||
float3 rgb_to_hsv(float3 c)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "com.coffee.ui-effect",
|
||||
"displayName": "UI Effect",
|
||||
"description": "UIEffect is an open-source package that allows you to intuitively apply rich UI effects directly from the Inspector or via code.\nCombine various filters, such as grayscale, blur, and dissolve, to decorate your UI with a unique visual style!",
|
||||
"version": "5.5.0",
|
||||
"version": "5.5.3",
|
||||
"unity": "2020.3",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
Reference in New Issue
Block a user