You've already forked ParticleEffectForUGUI
mirror of
https://github.com/mob-sakai/ParticleEffectForUGUI.git
synced 2026-05-14 12:10:08 +00:00
@@ -40,13 +40,26 @@ namespace Coffee.UIExtensions
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[InitializeOnLoadMethod]
|
||||
private static void InitializeOnLoad()
|
||||
{
|
||||
UIExtraCallbacks.onAfterCanvasRebuild += Refresh;
|
||||
|
||||
EditorApplication.playModeStateChanged += state =>
|
||||
{
|
||||
UIExtraCallbacks.onAfterCanvasRebuild -= Refresh;
|
||||
if (state == PlayModeStateChange.EnteredEditMode || state == PlayModeStateChange.EnteredPlayMode)
|
||||
{
|
||||
UIExtraCallbacks.onAfterCanvasRebuild += Refresh;
|
||||
}
|
||||
};
|
||||
}
|
||||
#else
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
|
||||
#endif
|
||||
private static void InitializeOnLoad()
|
||||
{
|
||||
UIExtraCallbacks.onAfterCanvasRebuild += Refresh;
|
||||
}
|
||||
#endif
|
||||
|
||||
private static void Refresh()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user