Skip to content

Commit 30bc9bb

Browse files
Thainatny-cesilco
authored andcommitted
Fix conditional compilation for activity button
1 parent fe8f86b commit 30bc9bb

4 files changed

Lines changed: 9 additions & 1 deletion

File tree

plug-ins/Apple.Core/Apple.Core_Unity/Assets/Apple.Core/Runtime/Availability.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ public static bool IsMethodAvailable(Type declaringType, string methodName, Type
197197
public static bool IsPropertyAvailable(Type declaringType, string propertyName, RuntimeEnvironment env = default) => IsMemberAvailable(declaringType.GetProperty(propertyName), env);
198198
public static bool IsPropertyAvailable<DeclaringType>(string propertyName, RuntimeEnvironment env = default) => IsPropertyAvailable(typeof(DeclaringType), propertyName, env);
199199

200+
#if !UNITY_EDITOR_WIN
200201
#region Init & Shutdown
201202
[RuntimeInitializeOnLoadMethod]
202203
private static void OnApplicationStart()
@@ -208,5 +209,6 @@ private static void OnApplicationStart()
208209
Debug.Log($"[Apple.Core Plug-In Runtime] Availability Runtime Environment: {env.RuntimeOperatingSystem.ToString()} {env.VersionNumber.Major}.{env.VersionNumber.Minor}");
209210
}
210211
#endregion
212+
#endif
211213
}
212214
}

plug-ins/Apple.GameKit/Apple.GameKit_Unity/Assets/Apple.GameKit/Demos/Apple.GameKit.Sample/Scripts/ActivityPanel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ void Start()
6565
await GKAccessPoint.Shared.TriggerWithGameActivityDefinitionID(Activity.ActivityDefinition.Identifier);
6666
}
6767
};
68-
#endif
6968

7069
_activityButton.ButtonClick += async (sender, args) =>
7170
{
@@ -74,6 +73,7 @@ void Start()
7473
await GKAccessPoint.Shared.TriggerWithGameActivity(Activity);
7574
}
7675
};
76+
#endif
7777

7878
_startButton.onClick.AddListener(StartButtonAction);
7979
_pauseButton.onClick.AddListener(PauseButtonAction);

plug-ins/Apple.GameKit/Apple.GameKit_Unity/Assets/Apple.GameKit/Source/DefaultHandlers.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ public static class DefaultNSExceptionHandler
1111
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
1212
public static void Init()
1313
{
14+
#if UNITY_IOS
1415
Interop.DefaultNSExceptionHandler_Set(ThrowNSException);
16+
#endif
1517
}
1618

1719
[MonoPInvokeCallback(typeof(NSExceptionCallback))]
@@ -32,7 +34,9 @@ public static class DefaultNSErrorHandler
3234
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
3335
public static void Init()
3436
{
37+
#if UNITY_IOS
3538
Interop.DefaultNSErrorHandler_Set(ThrowNSError);
39+
#endif
3640
}
3741

3842
[MonoPInvokeCallback(typeof(NSErrorCallback))]

plug-ins/Apple.GameKit/Apple.GameKit_Unity/Assets/Apple.GameKit/Source/GKGameActivity.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ public class GKGameActivity : NSObject
3030
/// </remarks>
3131
public static event WantsToPlayHandler WantsToPlay;
3232

33+
#if !UNITY_EDITOR_WIN
3334
static GKGameActivity()
3435
{
3536
if (Availability.IsTypeAvailable<GKGameActivity>())
3637
{
3738
Interop.GKGameActivity_SetWantsToPlayCallback(OnWantsToPlay);
3839
}
3940
}
41+
#endif
4042

4143
#if IOS_19_BETA_1_WANTSTOPLAY_MAIN_THREAD_WORKAROUND
4244
// In iOS 19 beta 1, the wantsToPlay callback isn't dispatched on the main thread.

0 commit comments

Comments
 (0)