Search Unity

IMGUI stripping?

Discussion in 'Web' started by Yandalf, Jul 3, 2019.

  1. Yandalf

    Yandalf

    Joined:
    Feb 11, 2014
    Posts:
    491
    I've made a minimal project where a component simply logs when some of Unity's standard events get fired (specifically Awake, Start, Update, and OnGUI).
    However, OnGUI seems to be not called depending on the build settings you setup.

    I've tested this project with Unity 2019.1.0f2, making builds either with or without engine code stripping and with either no exception handling, or full with stacktrace.
    This are the results:

    2019.1.0f2
    Not Stripped, No Exception Catching:

    Throws Unhandled Exception, calls Awake, Start, and Update once
    Not Stripped, Full Stacktrace:
    Calls OnGUI.
    Stripped, No Exception Catching:
    skips OnGUI calls and prints message "OnGUI function detected on MonoBehaviour, but not called, because IMGUI module is stripped."
    Stripped, Full Stacktrace:
    skips OnGUI calls and prints message "OnGUI function detected on MonoBehaviour, but not called, because IMGUI module is stripped."

    I'm quite surprised the IMGUI gets stripped seemingly by default now when stripping is enabled, this doesn't seem to be documented. To get OnGUI working I'm basically forced to build without stripping (no big deal) but with exception handling enabled (kindof a big deal). Is this a bug? How can I get OnGUI to work without exception handling?