Show / Hide Table of Contents

Interface INotchSimulatorTarget

Put it on any component to make it receive simulation calls from the Notch Simulator. Because in editor UnityEngine.Screen API is useless, instead we could receive some simulated values depending on what we have selected.

Namespace: E7.NotchSolution
Assembly: E7.NotchSolution.dll
Syntax
public interface INotchSimulatorTarget
Remarks

After 2019.3 finally there is an API that UnityEngine.Screen or UnityEngine.SystemInfo could be overridden. It is a base for Unity's own Device Simulator package.

Methods

SimulatorUpdate(Rect, Rect[])

Called frequently while the Notch Simulator is running.

Declaration
void SimulatorUpdate(Rect simulatedSafeAreaRelative, Rect[] simulatedCutoutsRelative)
Parameters
Type Name Description
UnityEngine.Rect simulatedSafeAreaRelative

Each values in the rect is 0~1, relative to the current screen size of active simulation device.

UnityEngine.Rect[] simulatedCutoutsRelative

Each values in the rect is 0~1, relative to the current screen size of active simulation device.

Remarks

If you have Device Simulator package, it is still called. Your script using this should decide if you want to stop using these values when you can now trust the UnityEngine.Screen or UnityEngine.SystemInfo that is now modified. (You may use this helper : ShouldUseNotchSimulatorValue)

In This Article
Back to top
A Unity plugin by 5argon from Exceed7 Experiments. Problems/suggestions/contact : 5argon@exceed7.com Discord