Unity-Technologies / InputSystem

An efficient and versatile input system for Unity.
Other
1.42k stars 306 forks source link

CHANGE: Use ProfilerMarker in place of Profiler based on Unity version and presence of com.unity.profiling.core package #1970

Closed surfnerd closed 1 month ago

surfnerd commented 1 month ago

Description

Use ProfilerMarker instead of Profiler.[Begin|End]Sample when the com.unity.profiling.core package is present at version 1.0.2 and the Unity version is 2020.3 or greater.

Changes made

A wrapper class, InputProfilerMarker, was added to encapsulate the #ifdef logic for using ProfilerMaker vs. Profiler. Most places that used to call Profiler now call InputProfilerMarker.

Testing

I ran a handful of tests on Yamato. The code analyzer test made me realize that I need to conditionally compile my changes based on the Unity Version and the presence of the com.unity.profiling.core package.

I also tested to ensure that the markers show up in the Profiler Window Timeline for both cases on a test project.

Risk

I believe the risk of this change is low as there are no feature changes or logic changes; it just replaces one profiler call with another based on the Unity version and package presence.

Checklist

Before review:

During merge:

After merge:

unity-cla-assistant commented 1 month ago

CLA assistant check
All committers have signed the CLA.