So I want to prevent stripping of my entire Assembly-CSharp. How do I do that?
Does this do the thing?
<linker>
<assembly fullname="UnityEngine">
<type fullname="UnityEngine.Animator" preserve="all"/>
</assembly>
<assembly fullname="Assembly-CSharp">
<type fullname="*" preserve="all"/>
</assembly>
</linker>
Also I kind of just want to include everything under the UnityEngine namespace no matter what… How do I do that?
just
<type fullname=“UnityEngine” preserve=“all”/>
seem to not do it
and
<type fullname=“UnityEngine.*” preserve=“all”/>
gives an error
Hmm… I’m not sure how you’d go about it… the problem is that your Monobehaviors and I think stuff inside the UnityEngine assembly don’t have a namespace (which technically means they are in the global namespace). What is getting stripped out of UnityEngine?
I am doing this somewhat peculiar thing, which is needed, but I don’t want to go into to much detailing.
But basically I am building the app with an ‘empty’ scene that has nothing in it. Then loading in ALL my content, and all my levels through AssetBundles. So if I have build stripping enabled, then literally no loaded levels work as everything got stripped. So I kind of wanted it to force it to keep everything in my assembly, everything in UnityEngine and just strip out the stuff in System and use micro mscorlib.
So you want stripping enabled but prevent stripping of some scripts?
You probably have a loader scene in your project. What if you add a script there that references all the scripts you need to retain? Something like
public class Ref : MonoBehaviour
{
public MyScript1 a;
public MyScript2 b;
public MyScript3 c;
....
}
Make sure that Ref is placed in some GameObject on the loader scene. And you don’t need to put anything into those fields, they’re just there to have dependency on the scripts…
Shouldn’t that prevent those scripts being stripped?
Cheers,
Sampsa
You still have to be somewhat careful. I’ve seen properties even get stripped even though a class remains.
I’ve taken to just having a dummy scene with every components and class put in it that gets included in the build…