Skip to content

Commit b96c6ea

Browse files
committed
style: Use option invoke
1 parent dd571ed commit b96c6ea

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Assets/JCSUnity/Scripts/Util/JCS_Util.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,17 +1147,15 @@ public static void WithActiveScene(Scene scene, System.Action action)
11471147
// If the same scene, just execute and leave.
11481148
if (oldScene == scene)
11491149
{
1150-
if (action != null)
1151-
action.Invoke();
1150+
action?.Invoke();
11521151

11531152
return;
11541153
}
11551154

11561155
// Switch to new scene.
11571156
SceneManager.SetActiveScene(scene);
11581157

1159-
if (action != null)
1160-
action.Invoke();
1158+
action?.Invoke();
11611159

11621160
// Revert back to old scene.
11631161
SceneManager.SetActiveScene(oldScene);

0 commit comments

Comments
 (0)