feat: make Unity integration optional

This commit is contained in:
cneicy committed 2026-10-03 23:36:43 +08:00
1 parent a92c9d2cea
commit 240d24ba7a
27 files changed
+916 -69

No files matched your search

@@ -0,0 +1,20 @@
#if SHRINK_EVENTBUS_HAS_SHARED_RUNTIME
using System;
using ShrinkSDK.Runtime;
namespace ShrinkEventBus.Integration
{
public sealed class ShrinkSharedMainThreadDispatcher : IShrinkEventBusMainThreadDispatcher
{
private readonly IShrinkMainThreadDispatcher _dispatcher;
public ShrinkSharedMainThreadDispatcher(IShrinkMainThreadDispatcher dispatcher)
{
_dispatcher = dispatcher ?? throw new ArgumentNullException(nameof(dispatcher));
}
public bool IsMainThread => _dispatcher.IsMainThread;
public bool TryPost(Action action) => _dispatcher.TryPost(action);
}
}
#endif