Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sator-imaging committed Mar 20, 2024
1 parent ab66dc7 commit 62d53c0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
18 changes: 9 additions & 9 deletions LifecycleBehaviour.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/** Simple Lifecycle Manager for Unity
/** CancellationToken based Lifecycle Manager for Unity
** (c) 2024 github.com/sator-imaging
** Licensed under the MIT License
This library helps managing MonoBehaviour lifetime by CancellationToken introduced in Unity 2022.
This library helps managing MonoBehaviour lifetime by `CancellationToken` introduced in Unity 2022.
Not only that but also has an ability to manage "Update" actions ordered and efficiently.
And also! library provides missing `destroyCancellationToken` feature for Unity 2021 LTS!!
**Feature Highlights**
- [Class Instance Lifetime Management](#object-lifetime-management)
- [Object Lifetime Management](#object-lifetime-management)
- [Update Function Manager](#update-function-manager)
- Designed to address consideration written in the following article
- https://blog.unity.com/engine-platform/10000-update-calls
Expand Down Expand Up @@ -101,7 +101,7 @@ Note that C# class instances and GameObjects destruction order is stable whereas
when scene is unloaded otherwise destroyed based on binding order.
> [!NOTE]
> To make destruction order stable, extension method automatically mark lifetime bound GameObjects as
> To make destruction order stable, extension method automatically marks lifetime bound GameObjects as
> `DontDestroyOnLoad`.
Expand Down Expand Up @@ -512,12 +512,12 @@ public void Clear()
/// Do nothing when null action specified.
/// </remarks>
/// <returns>
/// Returns received action instance as-is. It is null when null is passed.
/// <para>
/// Returns received action instance as-is. It is null when null is passed.
/// </para>
/// > [!NOTE]
/// > `Add(instance.Method)` will create new Action instance call by call implicitly.
/// > If plan to remove action later, removing requires exactly same instance so need to keep returned one.
/// </para>
/// </returns>
public Action Add(Action act)
{
Expand All @@ -540,11 +540,11 @@ public Action Add(Action act)
}

/// <remarks>
/// Do nothing when null action specified.
/// <para>
/// Do nothing when null action specified.
/// </para>
/// > [!WARNING]
/// > Item order will be changed. See file header document for details.
/// </para>
/// </remarks>
public void Remove(Action act)
{
Expand Down Expand Up @@ -745,7 +745,7 @@ public static class LifetimeExtensions
/// <summary>
/// Arguments: (obj, token, ticket, ownerOrNull)
/// <para>
/// Invoked before object bound to token.
/// Invoked when object bound to token or lifetime owner.
/// </para>
/// </summary>
public static Action<object, CancellationToken, CancellationTokenRegistration, object?>? DebuggerAction
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
This library helps managing MonoBehaviour lifetime by CancellationToken introduced in Unity 2022.
# CancellationToken based Lifecycle Manager for Unity

This library helps managing MonoBehaviour lifetime by `CancellationToken` introduced in Unity 2022.
Not only that but also has an ability to manage "Update" actions ordered and efficiently.

And also! library provides missing `destroyCancellationToken` feature for Unity 2021 LTS!!

**Feature Highlights**
- [Class Instance Lifetime Management](#object-lifetime-management)
- [Object Lifetime Management](#object-lifetime-management)
- [Update Function Manager](#update-function-manager)
- Designed to address consideration written in the following article
- https://blog.unity.com/engine-platform/10000-update-calls
Expand Down Expand Up @@ -97,7 +99,7 @@ destruction order is NOT stable. For reference, MonoBehaviours (components) will
when scene is unloaded otherwise destroyed based on binding order.

> [!NOTE]
> To make destruction order stable, extension method automatically mark lifetime bound GameObjects as
> To make destruction order stable, extension method automatically marks lifetime bound GameObjects as
> `DontDestroyOnLoad`.

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "com.sator-imaging.unity-lifecycle-manager",
"displayName": "MonoBehaviour Lifecycle Manager",
"displayName": "CancellationToken based Lifecycle Manager",
"version": "0.9.0",
"unity": "2021.3",
"description": "MonoBehaviour lifecycle and update function manager.",
"description": "Provides MonoBehaviour update function manager component and CancellationToken based object lifetime management.",
"author": {
"name": "Sator Imaging",
"url": "https://twitter.com/sator_imaging"
Expand Down

0 comments on commit 62d53c0

Please sign in to comment.