Closed mattluard closed 11 months ago
Thank you for your reporting! I would like to know more about this issue.
Could you please attach a minimal project (included Assets
, Packages
and ProjectSettings
directories) that reproduces the issue?
@mattluard
The issue is not reproduced on my environment...
Do you think adding the following code to UIParticle.cs would solve the issue?
[assembly:UnityEngine.Scripting.Preserve]
Same problem here. Built standalone on windows platform with il2cpp backend. I got the error log when running:
My best guess is this macro that causes the bug since this is the only macro I found wrap a SerializeField of UIParticle.cs:
UIParticle version: 4.1.7 Unity version: 2021.3.28f1
@ZhihaoJun umm... It is not reproduced on my environment.
UI Particle > Samples
Could you please attach a minimal project (included Assets, Packages and ProjectSettings directories) that reproduces the issue?
:tada: This issue has been resolved in version 4.2.2 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
Sorry for the late reply, but I'm glad the bug has been fixed.
Unfortunately, I encountered this issue again using the 4.4.0 version. This time I was building Android version of my game.
However, I managed to solve it by putting entire UIParticle project in the Assets
folder rather than in the Packages
like mentioned above.
I think this issue is related to AssetBundle building process because my UI prefab is loading from an AssetBundle. Everything is fine in the test project that is not using AssetBundle.
UIParticle version: 4.4.0 Unity version: 2021.3.28f1 IL2CPP backend
Optimization settings as below
Hi sir @mob-sakai , looks like this issue hasn't been fixed yet. UIParticle ver: 4.2.2 Unity ver: 2022.3.11f1 Please check. Thanks!
@ZhihaoJun Thank you for your reporting!
@tienassassin As a workaround, try the way that @ZhihaoJun said.
Could you please attach a minimal project (included Assets
, Packages
and ProjectSettings
directories) that reproduces the issue?
Hmm if I create an empty scene (same project as the one having the problem), then use UI Particle here, everything works fine... 😟
AssetDatabase.ForceReserializeAssets()
I think that the root cause is the different serialization layout
, meaning that the data structure differs between build time and load time.
Yeah, I upgraded Unity editor from 2022.3.7f1 to 2022.3.11f1 I just tried removing the UIParticle component, deleting the [generated] object then adding the UIParticle component again, everything works perfectly, it's a miracle Thanks for your dedicated help, sir @mob-sakai
If the same issue arises, please re-open this issue.
Hi, writing this here in case it helps someone else, in IL2CPP builds I got this error at runtime:
(The note about
#ifdef UNITY_EDITOR
does not apply here, firstly because this works fine in Mono builds and not in IL2CPP builds, but secondly because I don't think there's any#ifdef
's in the repo that match this description.)This problem, I believe, is actually due to Unity's code-stripping, if you have ParticleEffectForUGUI as a package installed from the Package Manager, Unity's going to mess up during the build and strip too much from the package. It doesn't matter if you move the Package from
/Library/PackageCache/
to/Packages/
, it still gets stripped.From the Unity docs on code stripping:
The solution, such as it is right now, is to not use ParticleEffectForUGUI as a package at all, but rather copy it right into your
/Assets/
folder.Nothing for @mob-sakai to do here, this is Unity's code stripping problem, except to perhaps add a note to the Installation section of the readme that says something like: "Due to Unity's code-stripping going too far, games targeting IL2CPP should not use the package installation but rather copy the repo into /Assets/, or else there will be serialization errors."