IL2CPP
From PowerUI
Revision as of 01:31, 13 March 2017 by 188.222.158.94 (talk) (→Code Stripping turned on? Add Preserve)
Platforms that use IL2CPP like WebGL and optionally mobiles need some special considerations.
Nitro Compiler
Firstly, you'll need to precompile all your Nitro and remove the Nitro compiler by ticking both boxes in Window > PowerUI > Nitro settings because IL2CPP errors if it encounters the libraries that the compiler uses.
Code Stripping turned on? Add Preserve
If you've got code stripping turned on, you'll need to add Preserve to the static methods that your UI uses, otherwise they'll be stripped out. Preserve can also be added more broadly if you want (i.e. preserve whole classes instead).
You can either use [UnityEngine.Scripting.Preserve] which requires at least Unity 5.4 or [Values.Preserve]:
[Values.Preserve]
public static void Hello(Dom.MouseEvent e){
// This method won't be stripped out by IL2CPP.
}