Friday, September 25, 2026

Simpleton v1.7.0 Released: Multiple Registrations in Deferred Reference & UniTask Integration!

I am excited to announce that Simpleton v1.7.0 is now officially available on the Unity Asset Store!


Simpleton is a lightweight, minimalistic Dependency Injection (DI) framework designed specifically for Unity game development. In this update, we are expanding the capabilities of `IDeferredReference<T>` by adding support for multiple instance registrations and broadcast notifications, as well as seamless asynchronous operations with UniTask integration.



πŸš€ What's New in v1.7.0


1. Multiple Registration & Broadcasting in IDeferredReference<T>

`IDeferredReference<T>` is designed to safely handle dependencies that are instantiated and destroyed at runtime (such as dynamic UI popups and spawned game views). In v1.7.0, multiple instances implementing the same interface can now be registered to a single deferred reference simultaneously.


By calling `ExecuteIfPresent(Action<T> action)`, Simpleton iterates and delivers the action to all currently registered instances in their registration order. If no instances are present, it safely skips execution without throwing exceptions or requiring explicit null/collection checks.


• Backward Compatible: The `.Value` property continues to return the most recently registered instance. When an instance is destroyed, `.Value` automatically reverts to the previous instance (or `null` if all are gone).

• Benefit: Perfect for broadcasting game state updates or notifications to multiple spawned views (e.g., world-space HUD indicators, minimap icons, status bars) without the sender needing to track how many views currently exist.



2. UniTask Integration (ExecuteIfPresentAsync)

For projects using UniTask, we have introduced the `DeferredReferenceUniTaskExtensions.ExecuteIfPresentAsync` extension method (available under the `FigCodeFactory.Simpleton.UniTask` assembly).


You can now trigger asynchronous tasks across all registered instances and await their collective completion via `UniTask.WhenAll` with a single line of code:


```csharp

await views.ExecuteIfPresentAsync(async view =>

{

    await view.PlaySpawnAnimationAsync();

});

```


If zero instances are registered, it returns an immediately completed `UniTask`. Simpleton automatically enables this extension when UniTask is installed via the Unity Package Manager (UPM).


• Benefit: Simplifies coordinating asynchronous UI transitions, cutscene triggers, and parallel visual effects across dynamically spawned GameObjects.



3. New Sample Scene & Updated AI Skills

• Sample 15 (15_DeferredReferenceMultipleRegistration): A new sample scene showcasing multiple time display views (SystemTimeDisplay and ElapsedTimeDisplay) dynamically toggled at runtime, receiving broadcast updates from a single presenter.

• Updated AI Skills: The built-in AI Skills (under `AI/Skills/`) have been updated to asset-version 1.7.0, complete with new scenario test coverage (S004) so AI coding assistants (like Claude and Gemini) can reliably adopt multi-registration patterns and UniTask workflows.

• User Guide: The User Guide PDF has been updated with detailed explanations, best practices, and code examples for multi-instance registration and UniTask usage.



πŸ“– Full Changelog


[1.7.0] - 2026-09

• Added multiple instance registration support to IDeferredReference<T>.

• Updated ExecuteIfPresent to broadcast actions to all registered instances in registration order.

• Maintained backward compatibility for IDeferredReference<T>.Value (returns the most recently registered instance and reverts to the previous one on unregistration).

• Added UniTask integration extension ExecuteIfPresentAsync for asynchronous broadcast operations.

• Added new sample scene: 15_DeferredReferenceMultipleRegistration.

• Added documentation for multiple registrations and UniTask integration to the User Guide PDF.

• Updated AI Skills to asset-version 1.7.0 with new benchmark scenario coverage.



πŸ”— Get Simpleton Today!


Update your project or get started with Simpleton today on the Unity Asset Store:


• Unity Asset Store: https://assetstore.unity.com/packages/tools/utilities/simpleton-326289

• Official Website: https://fig-code-factory.blogspot.com/


Thank you for using Simpleton! If you have any questions, suggestions, or feedback, please feel free to leave a review or reach out.

No comments:

Post a Comment

Simpleton v1.7.0 Released: Multiple Registrations in Deferred Reference & UniTask Integration!

I am excited to announce that Simpleton v1.7.0 is now officially available on the Unity Asset Store! Simpleton is a lightweight, minimalisti...