Search Unity

My function isn't generated - Is it a bug of Unity?

Discussion in 'Web' started by benzuk, Sep 3, 2017.

  1. benzuk

    benzuk

    Joined:
    Mar 11, 2014
    Posts:
    117
    Hi,

    I'm using .NET 4.6 and Unity 2017.1.0p5. On WebGL, I want to use a specific function, and I'm getting this error that tells me that my code was not generated correctly.

    Full log - https://pastebin.com/5NWFAHBh

    I'm gonna to investigate this asap and if it's a bug with unity I'll send a project example. If anyone knows what's wrong here or experienced something similar, I'd like to know.

    Thanks.
     
  2. benzuk

    benzuk

    Joined:
    Mar 11, 2014
    Posts:
    117
    So, I found some time to work on it and I figured out that is a bug with Unity. Here is a log about it: https://pastebin.com/emYddAKT ("ExecutionEngineException")

    I have a test project for this case. How can I contact Unity support asap about this case and give them the test project?

    If someone from Unity team can help me I'd be happy. This bug is happening on all versions of Unity 2017.

    EDIT: Case number is 953655.
     
    Last edited: Sep 24, 2017
  3. benzuk

    benzuk

    Joined:
    Mar 11, 2014
    Posts:
    117
    Hi,

    Actually, it's not a bug - my mistake. I'm trying to generate a generic type which is not supported on WebGL and related platforms (For more information look here: https://docs.unity3d.com/Manual/ScriptingRestrictions.html#AOT)

    Here is a solution for my situation according to a scripting restrictions: https://pastebin.com/XZr13YgP

    But this code will work only for EmptyParameters which inherits from IParameters. If I'll do a new type for parameters, like, "NoEmptyParameters inherits IParameters", and pass it to a Send function - It won't work.

    I don't know which solution can be for this case. Probably there is no solution for this case. I can duplicate on my code example "NoEmptyParameters" type, but it makes no sense because it will have a lot of duplication for each new type parameters.

    I hope someone will get a benefit from this case for the future.
     
    JoshPeterson likes this.