Skip to content

Commit 1ff09c5

Browse files
authored
Merge pull request #145 from annulusgames/update-docs
chore: Improve documents
2 parents c706fd0 + d9ccfdf commit 1ff09c5

60 files changed

Lines changed: 143 additions & 139 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Alchemy.SourceGenerator/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Source generator for Alchemy.
44

5-
# How to update the shipped DLL
5+
## How to update the shipped DLL
66

77
Unity consumes the compiled generator at
88
`Alchemy/Assets/Alchemy/Generator/Alchemy.SourceGenerator.dll`. After changing the generator, rebuild it with:

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
## Overview
1010

11-
Alchemy is a library that provides Inspector extensions using attributes.
11+
Alchemy is a library that provides attribute-based Inspector extensions.
1212

13-
In addition to providing easy and powerful attribute-based editor extensions, it allows serialization of any types (Dictionary, HashSet, Nullable, Tuple, etc.) via its own serialization system, so those types can be edited in the Inspector. Alchemy works simply by adding attributes to the target type — just mark it as `partial`, and a Source Generator creates the necessary code. Unlike Odin, there is no need to inherit from dedicated base classes.
13+
In addition to providing easy and powerful attribute-based editor extensions, Alchemy can serialize types that Unity does not normally support, such as dictionaries, hash sets, nullable value types, and tuples, so they can be edited in the Inspector. Add the appropriate attributes to a target type and mark it as `partial`; a source generator creates the necessary code. Unlike Odin, there is no need to inherit from dedicated base classes.
1414

1515
<img src="https://github.com/annulusgames/Alchemy/blob/main/docs/images/img-v2.0.png" width="800">
1616

@@ -20,7 +20,7 @@ v2.0 also adds EditorWindow and Hierarchy extensions. These make it easy to buil
2020

2121
* Add over 30 attributes to extend the Inspector
2222
* Support SerializeReference, allowing selection of types from a dropdown
23-
* Serialize any type (Dictionary, HashSet, Nullable, Tuple, etc.) and edit them in the Inspector
23+
* Serialize additional types, including dictionaries, hash sets, nullable value types, and tuples, and edit them in the Inspector
2424
* Create EditorWindows using attributes
2525
* Improve Hierarchy usability
2626
* Create custom attributes that work with Alchemy
@@ -29,20 +29,20 @@ v2.0 also adds EditorWindow and Hierarchy extensions. These make it easy to buil
2929

3030
### Requirements
3131

32-
* Unity 2021.2 or higher (Recommended: 2022.1 or higher for serialization extensions)
33-
* Unity Serialization 2.0 or higher (for serialization extensions)
32+
* Unity 2021.2 or later (Unity 2022.1 or later is recommended for serialization extensions)
33+
* Unity.Serialization 2.0 or later (for serialization extensions)
3434

3535
### Installation
3636

37-
1. Open Package Manager from Window > Package Manager
37+
1. Open the Package Manager from Window > Package Manager
3838
2. Click the "+" button > Add package from git URL
3939
3. Enter the following URL:
4040

4141
```
4242
https://github.com/annulusgames/Alchemy.git?path=/Alchemy/Assets/Alchemy
4343
```
4444

45-
Or open Packages/manifest.json and add the following to the dependencies block:
45+
Alternatively, open `Packages/manifest.json` and add the following entry to the `dependencies` block:
4646

4747
```json
4848
{
@@ -124,7 +124,7 @@ using UnityEngine;
124124
using Alchemy.Inspector;
125125

126126
[Serializable]
127-
public sealed class Example : IExample
127+
public sealed class Example
128128
{
129129
public float foo;
130130
public Vector3 bar;
@@ -213,7 +213,7 @@ Alchemy provides several features that extend the Hierarchy.
213213

214214
<img src="https://github.com/annulusgames/Alchemy/blob/main/docs/images/gif-hierarchy-toggle.gif" width="600">
215215

216-
You can add toggles for each object's active/inactive state and icons that show its components to the Hierarchy. These can be configured from Project Settings.
216+
You can display active-state toggles and component icons for each object in the Hierarchy. These features can be configured in Project Settings.
217217

218218
<img src="https://github.com/annulusgames/Alchemy/blob/main/docs/images/img-project-settings.png" width="600">
219219

@@ -223,8 +223,8 @@ From the Create menu, you can create objects that decorate the Hierarchy.
223223

224224
<img src="https://github.com/annulusgames/Alchemy/blob/main/docs/images/img-create-hierarchy-object.png" width="600">
225225

226-
These objects are automatically excluded from builds. (If they have child objects, any child objects are unparented before deletion.)
227-
For more details, refer to [Decorating Hierarchy](https://annulusgames.github.io/Alchemy/articles/en/decorating-hierarchy.html).
226+
These objects are automatically excluded from builds. If they have children, the children are unparented before the decorative objects are deleted.
227+
For more details, refer to [Decorating the Hierarchy](https://annulusgames.github.io/Alchemy/articles/en/decorating-hierarchy.html).
228228

229229
## AlchemyEditorWindow
230230

@@ -278,11 +278,11 @@ public class EditorWindowExample : AlchemyEditorWindow
278278

279279
<img src="https://github.com/annulusgames/Alchemy/blob/main/docs/images/img-editor-window.png" width="600">
280280

281-
Data for windows that inherit from `AlchemyEditorWindow` is saved as JSON in the project's ProjectSettings folder. For more details, refer to [Saving Editor Window Data](https://annulusgames.github.io/Alchemy/articles/en/saving-editor-window-data.html).
281+
Data for windows that inherit from `AlchemyEditorWindow` is saved as JSON in the project's `ProjectSettings` folder. For more details, refer to [Saving Editor Window Data](https://annulusgames.github.io/Alchemy/articles/en/saving-editor-window-data.html).
282282

283283
## Using Serialization Extensions
284284

285-
If you want to edit types that Unity cannot serialize, such as Dictionary, you can use the `[AlchemySerialize]` attribute to serialize these types.
285+
To edit types that Unity does not normally serialize, such as dictionaries, use the `[AlchemySerialize]` attribute.
286286

287287
Serialization extensions require the [Unity.Serialization](https://docs.unity3d.com/Packages/com.unity.serialization@3.1/manual/index.html) package. Additionally, reflection-based serialization using Unity.Serialization may not work in AOT environments prior to Unity 2022.1. Check the package manual for details.
288288

@@ -295,7 +295,7 @@ using UnityEngine;
295295
using Alchemy.Serialization;
296296

297297
// By adding the [AlchemySerialize] attribute, Alchemy's serialization extension is enabled.
298-
// It can be used with any type, regardless of its base class, but the target type must be partial for the Source Generator to generate code.
298+
// It can be used regardless of the target type's base class, but the target type must be partial for the source generator to generate code.
299299
[AlchemySerialize]
300300
public partial class AlchemySerializationExample : MonoBehaviour
301301
{

docs/articles/en/about.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
![header](../../images/header.png)
44

5-
Alchemy is a library that provides a rich set of editor extensions for Unity. By integrating Alchemy, over 30 attributes are added to easily extend the Inspector. Additionally, by utilizing the Unity.Serialization package and a dedicated Source Generator, it becomes possible to serialize and edit types not normally serializable in Unity (`Dictionary`, `HashSet`, `Nullable`, `ValueTuple`, etc.) directly from the Inspector.
5+
Alchemy is a library that provides a rich set of editor extensions for Unity. It includes more than 30 attributes that make it easy to extend the Inspector. With the Unity.Serialization package and a dedicated source generator, Alchemy can also serialize and edit types that Unity does not normally support, including `Dictionary`, `HashSet`, `Nullable`, and `ValueTuple`.
66

77
![img](../../images/img-v2.0.png)
88

9-
Furthermore, version 2.0 introduces new features such as EditorWindow extensions and Hierarchy extensions. These enable the easy creation of tools to streamline the development workflow within the editor.
9+
Version 2.0 also introduces editor-window and Hierarchy extensions. These features make it easy to build tools that streamline development workflows in the Unity Editor.

docs/articles/en/alchemy-editor-window.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ public class EditorWindowExample : AlchemyEditorWindow
5050

5151
![img](../../images/img-editor-window.png)
5252

53-
Data from windows created by inheriting `AlchemyEditorWindow` is saved in JSON format in the ProjectSettings folder of the project. For more details, refer to the [Saving Editor Window Data](saving-editor-window-data.md) page.
53+
Data for windows derived from `AlchemyEditorWindow` is saved as JSON in the project's `ProjectSettings` folder. For more details, refer to [Saving Editor Window Data](saving-editor-window-data.md).

docs/articles/en/alchemy-serialization-process.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Alchemy Serialization Process
22

3-
In Alchemy, by adding the `[AlchemySerialize]` attribute to the target type, a dedicated Source Generator automatically implements `ISerializationCallbackReceiver`. Within this process, all fields annotated with `[AlchemySerializeField]` are gathered, and using the Unity.Serialization package, they are converted to JSON format. However, fields of type `UnityEngine.Object` cannot be handled in JSON format, so their instances are saved in a single list, and only their indices are written to JSON.
3+
Adding `[AlchemySerialize]` to a target type causes Alchemy's source generator to implement `ISerializationCallbackReceiver`. It collects all fields marked with `[AlchemySerializeField]` and uses the Unity.Serialization package to serialize their data to JSON. Because references to `UnityEngine.Object` instances cannot be represented directly in JSON, Alchemy stores them in a separate list and writes their indices to the JSON data.
44

55
For example, consider the following class:
66

@@ -77,4 +77,4 @@ partial class AlchemySerializationExample : global::UnityEngine.ISerializationCa
7777
}
7878
```
7979

80-
Using `[AlchemySerializeField]` increases the processing load for serialization and deserialization. Therefore, it is recommended to avoid using `[AlchemySerializeField]` whenever possible.
80+
Using `[AlchemySerializeField]` adds serialization and deserialization overhead. Use it only for fields that Unity cannot serialize normally.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Assets Only Attribute
22

3-
Limits the reference that can be entered into an object field to assets only.
3+
Restricts an object field to asset references.
44

55
![img](../../../images/img-attribute-assets-only.png)
66

@@ -10,4 +10,4 @@ public Object asset1;
1010

1111
[AssetsOnly]
1212
public GameObject asset2;
13-
```
13+
```

docs/articles/en/attributes/blockquote.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ public float foo;
1111

1212
| Parameter | Description |
1313
| - | - |
14-
| Text | The text to display in the quotation |
14+
| Text | The text to display in the quotation |

docs/articles/en/attributes/box-group.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ public GameObject gamma;
2626

2727
| Parameter | Description |
2828
| - | - |
29-
| GroupPath | Specifies the path of the group. Groups can be nested by separating them with `/`. |
29+
| GroupPath | Specifies the path of the group. Groups can be nested by separating them with `/`. |

docs/articles/en/attributes/button.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ public void Foo(SampleClass parameter)
2727
builder.Append("baz = ").Append(parameter.baz == null ? "Null" : parameter.baz.ToString());
2828
Debug.Log("Foo: " + builder.ToString());
2929
}
30-
```
30+
```

docs/articles/en/attributes/disable-alchemy-editor.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Disable Alchemy Editor Attribute
22

3-
Disables the AlchemyEditor for the target class and uses the default Inspector for rendering. When this attribute is added to a field, only that field will be rendered using the default PropertyField.
3+
Disables `AlchemyEditor` for the target class and uses the default Inspector instead. When this attribute is added to a field, only that field is rendered using the default `PropertyField`.
44

55
![img](../../../images/img-attribute-disable-alchemy-editor.png)
66

@@ -12,4 +12,4 @@ public class DisableAlchemyEditorExample : MonoBehaviour
1212
public Vector3 bar;
1313
public GameObject baz;
1414
}
15-
```
15+
```

0 commit comments

Comments
 (0)