The Ingame Resolution Monitor is a simple MonoBehvaiour which triggers the logic of the Resolution Monitor during runtime.

If the user can change the screen resolution inside of your application, you should use it.

If you are supporting more than one screen type (e.g. Landscape + Portrait) you also should use it, because it needs to inform the UI whenever a new scene is loaded (or when it detects changes).


Creation


Via Code

To create the Ingame Resolution Monitor, call the following code once at start of your game:


TheraBytes.BetterUi.IngameResolutionMonitor.Create();



Once created, the Ingame Resolution Monitor will not be destroyed anymore. 

So, make sure to create only one at the beginning of the application and not more.


In Unity

Possible since Better UI 2.4


If you want to detect resolution changes anytime, open the first scene you load in your game and add a new Game Object to the Hierarchy and Add the Component "In-Game Resolution Monitor" to it. Nothing else to do.

You only need to do this in one scene. But it will detect if it is present in multiple scenes and will automatically only allow one instance of it.


If you have one certain scene where a resolution change can happen, you can add the component to that scene instead and check "Only Present In This Scene".


Alternative

If you do not need to detect resolution changes because you can only change the resolution at one place in your options, you can trigger the Resolution Monitor after changing the resolution manually like this:


TheraBytes.BetterUi.ResolutionMonitor.MarkDirty();

TheraBytes.BetterUi.ResolutionMonitor.Update();