Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ public static bool IsMethodAvailable(Type declaringType, string methodName, Type
public static bool IsPropertyAvailable(Type declaringType, string propertyName, RuntimeEnvironment env = default) => IsMemberAvailable(declaringType.GetProperty(propertyName), env);
public static bool IsPropertyAvailable<DeclaringType>(string propertyName, RuntimeEnvironment env = default) => IsPropertyAvailable(typeof(DeclaringType), propertyName, env);

#if !UNITY_EDITOR_WIN
#region Init & Shutdown
[RuntimeInitializeOnLoadMethod]
private static void OnApplicationStart()
Expand All @@ -208,5 +209,6 @@ private static void OnApplicationStart()
Debug.Log($"[Apple.Core Plug-In Runtime] Availability Runtime Environment: {env.RuntimeOperatingSystem.ToString()} {env.VersionNumber.Major}.{env.VersionNumber.Minor}");
}
#endregion
#endif
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ void Start()
await GKAccessPoint.Shared.TriggerWithGameActivityDefinitionID(Activity.ActivityDefinition.Identifier);
}
};
#endif

_activityButton.ButtonClick += async (sender, args) =>
{
Expand All @@ -74,6 +73,7 @@ void Start()
await GKAccessPoint.Shared.TriggerWithGameActivity(Activity);
}
};
#endif

_startButton.onClick.AddListener(StartButtonAction);
_pauseButton.onClick.AddListener(PauseButtonAction);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ public static class DefaultNSExceptionHandler
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
public static void Init()
{
#if UNITY_IOS
Interop.DefaultNSExceptionHandler_Set(ThrowNSException);
#endif
}

[MonoPInvokeCallback(typeof(NSExceptionCallback))]
Expand All @@ -32,7 +34,9 @@ public static class DefaultNSErrorHandler
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
public static void Init()
{
#if UNITY_IOS
Interop.DefaultNSErrorHandler_Set(ThrowNSError);
#endif
}

[MonoPInvokeCallback(typeof(NSErrorCallback))]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ public class GKGameActivity : NSObject
/// </remarks>
public static event WantsToPlayHandler WantsToPlay;

#if !UNITY_EDITOR_WIN
static GKGameActivity()
{
if (Availability.IsTypeAvailable<GKGameActivity>())
{
Interop.GKGameActivity_SetWantsToPlayCallback(OnWantsToPlay);
}
}
#endif

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