Skip to content

Commit

Permalink
xbox native client: add support for XBox One
Browse files Browse the repository at this point in the history
Use UNITY_GAMECORE_XBOXONE in conditional code throughout backtrace-unity
when building against the XBox One platform.

Note that the same underlying binary used by the integration,
backtrace_native_xbox.dll, can be used on either the XBox One or XBox
Series X/S platform. There is no need to distribute a separate DLL.

Internal ref BT-5310
  • Loading branch information
gm4sl committed Dec 2, 2024
1 parent 740010b commit 57fbda6
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Editor/BacktraceConfigurationEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public override void OnInspectorGUI()
#endif


#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_WIN || UNITY_GAMECORE_XBOXSERIES || UNITY_STANDALONE_OSX
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_WIN || UNITY_GAMECORE_XBOXSERIES || UNITY_GAMECORE_XBOXONE || UNITY_STANDALONE_OSX
SerializedProperty captureNativeCrashes = serializedObject.FindProperty("CaptureNativeCrashes");
EditorGUILayout.PropertyField(
captureNativeCrashes,
Expand All @@ -148,7 +148,7 @@ public override void OnInspectorGUI()
EditorGUILayout.HelpBox("You're using Backtrace-Unity integration with Unity 16b NDK support. Please contact Backtrace support for any additional help", MessageType.Warning);
}
#endif
#if !UNITY_GAMECORE_XBOXSERIES
#if !UNITY_GAMECORE_XBOXSERIES && !UNITY_GAMECORE_XBOXONE
EditorGUILayout.PropertyField(
serializedObject.FindProperty("HandleANR"),
new GUIContent(BacktraceConfigurationLabels.LABEL_HANDLE_ANR));
Expand Down
2 changes: 1 addition & 1 deletion Runtime/Model/BacktraceConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public class BacktraceConfiguration : ScriptableObject
/// Capture native NDK Crashes.
/// </summary>
[Tooltip("Capture native NDK Crashes (ANDROID API 21+)")]
#elif UNITY_IOS || UNITY_STANDALONE_WIN || UNITY_GAMECORE_XBOXSERIES || UNITY_STANDALONE_OSX
#elif UNITY_IOS || UNITY_STANDALONE_WIN || UNITY_GAMECORE_XBOXSERIES || UNITY_GAMECORE_XBOXONE || UNITY_STANDALONE_OSX
/// <summary>
/// Capture native crashes.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion Runtime/Native/Base/NativeClientBase.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_WIN || UNITY_GAMECORE_XBOXSERIES || UNITY_STANDALONE_OSX
#if UNITY_ANDROID || UNITY_IOS || UNITY_STANDALONE_WIN || UNITY_GAMECORE_XBOXSERIES || UNITY_GAMECORE_XBOXONE || UNITY_STANDALONE_OSX
using Backtrace.Unity.Model;
using Backtrace.Unity.Model.Breadcrumbs;
using Backtrace.Unity.Extensions;
Expand Down
2 changes: 1 addition & 1 deletion Runtime/Native/NativeClientFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ internal static INativeClient CreateNativeClient(BacktraceConfiguration configur
{
#if UNITY_EDITOR
return null;
#elif UNITY_GAMECORE_XBOXSERIES
#elif UNITY_GAMECORE_XBOXSERIES || UNITY_GAMECORE_XBOXONE
return new XBOX.NativeClient(configuration, breadcrumbs, attributes, attachments);
#elif UNITY_STANDALONE_WIN
return new Windows.NativeClient(configuration, breadcrumbs, attributes, attachments);
Expand Down
4 changes: 2 additions & 2 deletions Runtime/Native/XBOX/NativeClient.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if UNITY_GAMECORE_XBOXSERIES
#if UNITY_GAMECORE_XBOXSERIES || UNITY_GAMECORE_XBOXONE
using Backtrace.Unity.Interfaces;
using Backtrace.Unity.Model;
using Backtrace.Unity.Model.Breadcrumbs;
Expand Down Expand Up @@ -41,7 +41,7 @@ private static extern bool BacktraceNativeXboxInit(
/// Determine if the XBOX integration should be enabled
/// </summary>
private bool _enabled =
#if UNITY_GAMECORE_XBOXSERIES && !UNITY_EDITOR
#if !UNITY_EDITOR
true;
#else
false;
Expand Down

0 comments on commit 57fbda6

Please sign in to comment.