chore: initialize standalone UPM package
Publish UPM package / publish (push) Failing after 1s

This commit is contained in:
2026-08-26 02:50:25 +08:00
commit 50da51bd7f
22 changed files with 393 additions and 0 deletions
+53
View File
@@ -0,0 +1,53 @@
#nullable enable
using System;
using ShrinkEventBus;
using Unity.Collections;
namespace ShrinkEventBus.Entities
{
/// <summary>Burst-safe producer queue; playback enters the regular Bus instance.</summary>
public sealed class ShrinkEcsEventQueue<TEvent> : IDisposable where TEvent : unmanaged, IShrinkEvent
{
private NativeQueue<TEvent> _queue;
public ShrinkEcsEventQueue(Allocator allocator = Allocator.Persistent)
{
_queue = new NativeQueue<TEvent>(allocator);
Writer = new ShrinkEcsEventWriter<TEvent>(_queue.AsParallelWriter());
}
public ShrinkEcsEventWriter<TEvent> Writer { get; }
public int Playback(IShrinkEventBus bus)
{
if (bus == null)
throw new ArgumentNullException(nameof(bus));
var count = 0;
while (_queue.TryDequeue(out var eventData))
{
bus.Post(in eventData);
count++;
}
return count;
}
public void Dispose()
{
if (_queue.IsCreated)
_queue.Dispose();
}
}
public readonly struct ShrinkEcsEventWriter<TEvent> where TEvent : unmanaged, IShrinkEvent
{
private readonly NativeQueue<TEvent>.ParallelWriter _writer;
internal ShrinkEcsEventWriter(NativeQueue<TEvent>.ParallelWriter writer)
{
_writer = writer;
}
public void Post(in TEvent eventData) => _writer.Enqueue(eventData);
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 05a2db7ffefb4841bdcd63d8fd3ac6fe
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,13 @@
{
"name": "ShrinkEventBus.Entities.Runtime",
"rootNamespace": "ShrinkEventBus.Entities",
"references": [
"ShrinkEventBus.Runtime",
"Unity.Collections",
"Unity.Entities"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": true,
"autoReferenced": false
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9e31f017584a4a04992bb6fa7538cb2f
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: