mirror of
https://github.com/mob-sakai/UIEffect.git
synced 2026-11-19 17:22:37 +08:00
fix: some methods may be called multiple times when domain reload on play is disabled (editor)
This commit is contained in:
@@ -111,10 +111,19 @@ namespace Coffee.UIEffects
|
||||
private static readonly HashSet<TextMeshProUGUI> s_RegisteredInstances = new HashSet<TextMeshProUGUI>();
|
||||
private static readonly Dictionary<int, float> s_SdfScaleCache = new Dictionary<int, float>();
|
||||
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
|
||||
private static void RuntimeInitializeOnLoadMethod()
|
||||
{
|
||||
s_ChangedInstances.Clear();
|
||||
s_RegisteredInstances.Clear();
|
||||
s_SdfScaleCache.Clear();
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[InitializeOnLoadMethod]
|
||||
#endif
|
||||
#else
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
|
||||
#endif
|
||||
private static void InitializeOnLoad()
|
||||
{
|
||||
s_ChangedInstances.Clear();
|
||||
|
||||
Reference in New Issue
Block a user