Search Unity

Code injection before IL2CPP starts

Discussion in 'Editor & General Support' started by jehovah0121qq, May 24, 2017.

  1. jehovah0121qq

    jehovah0121qq

    Joined:
    Nov 14, 2013
    Posts:
    68
    Hi. If I use IL2CPP as the scripting backend, is it possible for me to inject the C# assemblies with libraries like Mono.Cecil before these assemblies are converted into C++ code? Is there a hook function like OnPostprocessBuild?
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,931
    There is nothing specific to IL2CPP in this respect. You should have all of the same hooks that Unity provides for the Mono scripting backend as well.
     
  3. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,090
  4. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,090
    Hmm what about code injection to cpp files after il2cpp? I'd like to fix the cause of Unity.Mathematics being very slow.

    Edit
    Possible by selecting "Create Visual Studio solution"
     
    Last edited: Apr 23, 2020
  5. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,090
    :(
     
  6. jehovah0121qq

    jehovah0121qq

    Joined:
    Nov 14, 2013
    Posts:
    68
    OnPostProcessScene callback, in which you can do everything.