Add GenericDelegate<RaycastHit> to AOTLinker

echtnice

Member
Hi.

I ran into the following error while testing my game in WebGL

Code:
gunfu-webgl.framework.js:3311 ExecutionEngineException: Attempting to call method 'Opsive.UltimateCharacterController.StateSystem.Preset+GenericDelegate`1[[UnityEngine.RaycastHit, UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]::.ctor' for which no ahead of time (AOT) code was generated.

Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00000] in <00000000000000000000000000000000>:0

(Filename: currently not available on il2cpp Line: -1)

I've added the corresponding definition to the AOTLinker and now it works just fine. Not sure if this is only caused by my code but maybe RaycastHit is generic enough to upstream it?

AOTLinker.cs
Code:
        public void Linker()
        {
          ...
          var raycastHitGenericDelegate = new Preset.GenericDelegate<RaycastHit>();
          ...
        }

Thanks!
 

Justin

Administrator
Staff member
RaycastHit is generic enough to add so I can definitely add it. I wonder though why you are hitting this error and it hasn't come up before. Oh well, it's an easy change that doesn't hurt anything else.
 
Top