Search Unity

OnGUI + Hololens

Discussion in '2D' started by davidlannan, Feb 5, 2019.

  1. davidlannan

    davidlannan

    Joined:
    Jul 11, 2013
    Posts:
    48
    Has anyone successfully used OnGUI draw functions on the HoloLens?
    I cannot seem to get anything to work. Any suggestion would be greatly appreciated.
    Theres an unanswered question in the MS forums about this, which makes me worried this wont work (which we rely upon for our sims across multiple platforms).
     
  2. davidlannan

    davidlannan

    Joined:
    Jul 11, 2013
    Posts:
    48
    Okay its been a couple of days and I think I have found the problem.
    Its in the IL2CPP - we have some script calling into Unity and it is not being able to access any of the objects because the compiler has stripped the classes and objects clean.
    By adding "dummy" objects the classes get included and the scripts work.
    There are notes in a blog about being able to add a Type list for the IL2CPP, but its only happening on the HoloLens, so our solution has been to simply make a "junk" maker that creates instances (and then kills them) of types we will use on the HoloLens. This, I am glad to say, finally works.
    Ideally, it would be good to know why the behaviour of the HoloLens vs all the other platforms is different?