Add: Japanese docs
8
docs/articles/ja/about.md
Normal file
@ -0,0 +1,8 @@
|
||||
# Alchemyとは
|
||||
|
||||
![header](../../images/header.png)
|
||||
|
||||
AlchemyはUnity向けの豊富なエディタ拡張の機能を提供するライブラリです。Inspectorを手軽に拡張するための30以上の属性が追加されるほか、Unity.Serializationパッケージと専用のSource Generatorを使用することで、通常のUnityではシリアル化できない型(`Dictionary`, `HashSet`, `Nullable`, `ValueTuple`, etc.)をシリアル化してInspectorから編集することを可能にします。
|
||||
|
||||
またv2.0の新機能として、EditorWindow拡張とHierarchy拡張が追加されました。これらを用いることで、エディタでの開発フローを効率化するツールを簡単に作成できるようになります。
|
||||
|
13
docs/articles/ja/attributes/assets-only.md
Normal file
@ -0,0 +1,13 @@
|
||||
# Assets Only Attribute
|
||||
|
||||
オブジェクトのフィールドに入力可能な参照をアセットに限定します。
|
||||
|
||||
![img](../../../images/img-attribute-assets-only.png)
|
||||
|
||||
```cs
|
||||
[AssetsOnly]
|
||||
public Object asset1;
|
||||
|
||||
[AssetsOnly]
|
||||
public GameObject asset2;
|
||||
```
|
14
docs/articles/ja/attributes/blockquote.md
Normal file
@ -0,0 +1,14 @@
|
||||
# Blockquote Attribute
|
||||
|
||||
Inspector上に引用句を表示します。
|
||||
|
||||
![img](../../../images/img-attribute-blockquote.png)
|
||||
|
||||
```cs
|
||||
[Blockquote("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.")]
|
||||
public float foo;
|
||||
```
|
||||
|
||||
| パラメータ | 説明 |
|
||||
| - | - |
|
||||
| Text | 引用句に表示するテキスト |
|
29
docs/articles/ja/attributes/box-group.md
Normal file
@ -0,0 +1,29 @@
|
||||
# Box Group Attribute
|
||||
|
||||
複数のメンバーをボックスにまとめて表示するグループを作成します。
|
||||
|
||||
![img](../../../images/img-attribute-box-group.png)
|
||||
|
||||
```cs
|
||||
[BoxGroup("Group1")]
|
||||
public float foo;
|
||||
|
||||
[BoxGroup("Group1")]
|
||||
public Vector3 bar;
|
||||
|
||||
[BoxGroup("Group1")]
|
||||
public GameObject baz;
|
||||
|
||||
[BoxGroup("Group1/Group2")]
|
||||
public float alpha;
|
||||
|
||||
[BoxGroup("Group1/Group2")]
|
||||
public Vector3 beta;
|
||||
|
||||
[BoxGroup("Group1/Group2")]
|
||||
public GameObject gamma;
|
||||
```
|
||||
|
||||
| パラメータ | 説明 |
|
||||
| - | - |
|
||||
| GroupPath | グループのパスを指定します。グループは`/`で区切ることでネストすることが可能です。 |
|
30
docs/articles/ja/attributes/button.md
Normal file
@ -0,0 +1,30 @@
|
||||
# Button Attribute
|
||||
|
||||
メソッドを実行可能なボタンをInspectorに表示します。メソッドが引数を持つ場合には、引数を入力可能なフィールドが追加されます。
|
||||
|
||||
![img](../../../images/img-attribute-button.png)
|
||||
|
||||
```cs
|
||||
[Button]
|
||||
public void Foo()
|
||||
{
|
||||
Debug.Log("Foo");
|
||||
}
|
||||
|
||||
[Button]
|
||||
public void Foo(int parameter)
|
||||
{
|
||||
Debug.Log("Foo: " + parameter);
|
||||
}
|
||||
|
||||
[Button]
|
||||
public void Foo(SampleClass parameter)
|
||||
{
|
||||
var builder = new StringBuilder();
|
||||
builder.AppendLine();
|
||||
builder.Append("foo = ").AppendLine(parameter.foo.ToString());
|
||||
builder.Append("bar = ").AppendLine(parameter.bar.ToString());
|
||||
builder.Append("baz = ").Append(parameter.baz == null ? "Null" : parameter.baz.ToString());
|
||||
Debug.Log("Foo: " + builder.ToString());
|
||||
}
|
||||
```
|
27
docs/articles/ja/attributes/disable-if.md
Normal file
@ -0,0 +1,27 @@
|
||||
# Disable If Attribute
|
||||
|
||||
対象のメンバーのbool値がtrueの場合、フィールドが編集不可能になります。
|
||||
|
||||
![img](../../../images/img-attribute-disable-if-false.png)
|
||||
|
||||
![img](../../../images/img-attribute-disable-if-true.png)
|
||||
|
||||
```cs
|
||||
public bool isDisabled;
|
||||
|
||||
public bool IsDisabled => isDisabled;
|
||||
public bool IsDisabledMethod() => isDisabled;
|
||||
|
||||
[DisableIf("isDisabled")]
|
||||
public int disableIfField;
|
||||
|
||||
[DisableIf("IsDisabled")]
|
||||
public int disableIfProperty;
|
||||
|
||||
[DisableIf("IsDisabledMethod")]
|
||||
public int disableIfMethod;
|
||||
```
|
||||
|
||||
| パラメータ | 説明 |
|
||||
| - | - |
|
||||
| Condition | 条件の判定に使用するフィールド、プロパティまたはメソッドの名前 |
|
12
docs/articles/ja/attributes/disable-in-edit-mode.md
Normal file
@ -0,0 +1,12 @@
|
||||
# Disable In Edit Mode Attribute
|
||||
|
||||
Edit Mode中はフィールドが編集不可能になります。
|
||||
|
||||
![img](../../../images/img-attribute-disable-in-edit-mode-editor.png)
|
||||
|
||||
![img](../../../images/img-attribute-disable-in-edit-mode-player.png)
|
||||
|
||||
```cs
|
||||
[DisableInEditMode]
|
||||
public float foo;
|
||||
```
|
12
docs/articles/ja/attributes/disable-in-play-mode.md
Normal file
@ -0,0 +1,12 @@
|
||||
# Disable In Play Mode Attribute
|
||||
|
||||
Play Mode中はフィールドが編集不可能になります。
|
||||
|
||||
![img](../../../images/img-attribute-disable-in-play-mode-editor.png)
|
||||
|
||||
![img](../../../images/img-attribute-disable-in-play-mode-player.png)
|
||||
|
||||
```cs
|
||||
[DisableInPlayMode]
|
||||
public float foo;
|
||||
```
|
27
docs/articles/ja/attributes/enable-if.md
Normal file
@ -0,0 +1,27 @@
|
||||
# Enable If Attribute
|
||||
|
||||
対象のメンバーのbool値がtrueの場合にのみフィールドを編集可能になります。
|
||||
|
||||
![img](../../../images/img-attribute-enable-if-false.png)
|
||||
|
||||
![img](../../../images/img-attribute-enable-if-true.png)
|
||||
|
||||
```cs
|
||||
public bool isEnabled;
|
||||
|
||||
public bool IsEnabled => isEnabled;
|
||||
public bool IsEnabledMethod() => isEnabled;
|
||||
|
||||
[EnableIf("isEnabled")]
|
||||
public int enableIfField;
|
||||
|
||||
[EnableIf("IsEnabled")]
|
||||
public int enableIfProperty;
|
||||
|
||||
[EnableIf("IsEnabledMethod")]
|
||||
public int enableIfMethod;
|
||||
```
|
||||
|
||||
| パラメータ | 説明 |
|
||||
| - | - |
|
||||
| Condition | 条件の判定に使用するフィールド、プロパティまたはメソッドの名前 |
|
29
docs/articles/ja/attributes/foldout-group.md
Normal file
@ -0,0 +1,29 @@
|
||||
# Foldout Group Attribute
|
||||
|
||||
複数のメンバーを折りたたみ可能なグループを作成します。
|
||||
|
||||
![img](../../../images/img-attribute-foldout-group.png)
|
||||
|
||||
```cs
|
||||
[FoldoutGroup("Group1")]
|
||||
public float foo;
|
||||
|
||||
[FoldoutGroup("Group1")]
|
||||
public Vector3 bar;
|
||||
|
||||
[FoldoutGroup("Group1")]
|
||||
public GameObject baz;
|
||||
|
||||
[FoldoutGroup("Group2")]
|
||||
public float alpha;
|
||||
|
||||
[FoldoutGroup("Group2")]
|
||||
public Vector3 beta;
|
||||
|
||||
[FoldoutGroup("Group2")]
|
||||
public GameObject gamma;
|
||||
```
|
||||
|
||||
| パラメータ | 説明 |
|
||||
| - | - |
|
||||
| GroupPath | グループのパスを指定します。グループは`/`で区切ることでネストすることが可能です。 |
|
29
docs/articles/ja/attributes/group.md
Normal file
@ -0,0 +1,29 @@
|
||||
# Group Attribute
|
||||
|
||||
複数のメンバーをまとめて表示するグループを作成します。
|
||||
|
||||
![img](../../../images/img-attribute-group.png)
|
||||
|
||||
```cs
|
||||
[Group("Group1")]
|
||||
public float foo;
|
||||
|
||||
[Group("Group1")]
|
||||
public Vector3 bar;
|
||||
|
||||
[Group("Group1")]
|
||||
public GameObject baz;
|
||||
|
||||
[Group("Group2")]
|
||||
public float alpha;
|
||||
|
||||
[Group("Group2")]
|
||||
public Vector3 beta;
|
||||
|
||||
[Group("Group2")]
|
||||
public GameObject gamma;
|
||||
```
|
||||
|
||||
| パラメータ | 説明 |
|
||||
| - | - |
|
||||
| GroupPath | グループのパスを指定します。グループは`/`で区切ることでネストすることが可能です。 |
|
21
docs/articles/ja/attributes/help-box.md
Normal file
@ -0,0 +1,21 @@
|
||||
# Help Box Attribute
|
||||
|
||||
フィールドの上にメモや警告を追加します。
|
||||
|
||||
![img](../../../images/img-attribute-help-box.png)
|
||||
|
||||
```cs
|
||||
[HelpBox("Custom Info")]
|
||||
public float foo;
|
||||
|
||||
[HelpBox("Custom Warning", HelpBoxMessageType.Warning)]
|
||||
public Vector2 bar;
|
||||
|
||||
[HelpBox("Custom Error", HelpBoxMessageType.Error)]
|
||||
public GameObject baz;
|
||||
```
|
||||
|
||||
| パラメータ | 説明 |
|
||||
| - | - |
|
||||
| Message | ボックス内に表示するテキスト |
|
||||
| MessageType | メッセージの種類 |
|
28
docs/articles/ja/attributes/hide-if.md
Normal file
@ -0,0 +1,28 @@
|
||||
# Hide If Attribute
|
||||
|
||||
対象のメンバーのbool値がtrueの場合はInspectorに表示されなくなります。
|
||||
|
||||
![img](../../../images/img-attribute-hide-if-false.png)
|
||||
|
||||
![img](../../../images/img-attribute-hide-if-true.png)
|
||||
|
||||
```cs
|
||||
public bool hide;
|
||||
|
||||
public bool Hide => hide;
|
||||
public bool IsHideTrue() => hide;
|
||||
|
||||
[HideIf("hide")]
|
||||
public int hideIfField;
|
||||
|
||||
[HideIf("Hide")]
|
||||
public int hideIfProperty;
|
||||
|
||||
[HideIf("IsHideTrue")]
|
||||
public int hideIfMethod;
|
||||
```
|
||||
|
||||
|
||||
| パラメータ | 説明 |
|
||||
| - | - |
|
||||
| Condition | 条件の判定に使用するフィールド、プロパティまたはメソッドの名前 |
|
12
docs/articles/ja/attributes/hide-in-edit-mode.md
Normal file
@ -0,0 +1,12 @@
|
||||
# Hide In Edit Mode Attribute
|
||||
|
||||
Edit Mode中はフィールドが非表示になります。
|
||||
|
||||
![img](../../../images/img-attribute-hide-in-edit-mode-editor.png)
|
||||
|
||||
![img](../../../images/img-attribute-hide-in-edit-mode-player.png)
|
||||
|
||||
```cs
|
||||
[HideInEditMode]
|
||||
public float foo;
|
||||
```
|
12
docs/articles/ja/attributes/hide-in-play-mode.md
Normal file
@ -0,0 +1,12 @@
|
||||
# Hide In Play Mode Attribute
|
||||
|
||||
Play Mode中はフィールドが非表示になります。
|
||||
|
||||
![img](../../../images/img-attribute-hide-in-play-mode-editor.png)
|
||||
|
||||
![img](../../../images/img-attribute-hide-in-play-mode-player.png)
|
||||
|
||||
```cs
|
||||
[HideInPlayMode]
|
||||
public float foo;
|
||||
```
|
16
docs/articles/ja/attributes/hide-label.md
Normal file
@ -0,0 +1,16 @@
|
||||
# Hide Label Attribute
|
||||
|
||||
フィールドのラベルを非表示にします。
|
||||
|
||||
![img](../../../images/img-attribute-hide-label.png)
|
||||
|
||||
```cs
|
||||
[HideLabel]
|
||||
public float foo;
|
||||
|
||||
[HideLabel]
|
||||
public Vector3 bar;
|
||||
|
||||
[HideLabel]
|
||||
public GameObject baz;
|
||||
```
|
15
docs/articles/ja/attributes/hide-script-field.md
Normal file
@ -0,0 +1,15 @@
|
||||
# Hide Script Field Attribute
|
||||
|
||||
対象のScriptフィールドを非表示にします。
|
||||
|
||||
![img](../../../images/img-attribute-hide-script-field.png)
|
||||
|
||||
```cs
|
||||
[HideScriptField]
|
||||
public class HideScriptFieldSample : MonoBehaviour
|
||||
{
|
||||
public float foo;
|
||||
public Vector3 bar;
|
||||
public GameObject baz;
|
||||
}
|
||||
```
|
44
docs/articles/ja/attributes/horizontal-group.md
Normal file
@ -0,0 +1,44 @@
|
||||
# Horizontal Attribute
|
||||
|
||||
複数のメンバーを水平方向に並べて表示するグループを作成します。
|
||||
|
||||
![img](../../../images/img-attribute-horizontal-group.png)
|
||||
|
||||
```cs
|
||||
[HorizontalGroup("Group1")]
|
||||
public int a;
|
||||
|
||||
[HorizontalGroup("Group1")]
|
||||
public int b;
|
||||
|
||||
[HorizontalGroup("Group1")]
|
||||
public int c;
|
||||
|
||||
[HorizontalGroup("Group2")]
|
||||
[BoxGroup("Group2/Box1")]
|
||||
public float foo;
|
||||
|
||||
[HorizontalGroup("Group2")]
|
||||
[BoxGroup("Group2/Box1")]
|
||||
public Vector3 bar;
|
||||
|
||||
[HorizontalGroup("Group2")]
|
||||
[BoxGroup("Group2/Box1")]
|
||||
public GameObject baz;
|
||||
|
||||
[HorizontalGroup("Group2")]
|
||||
[BoxGroup("Group2/Box2")]
|
||||
public float alpha;
|
||||
|
||||
[HorizontalGroup("Group2")]
|
||||
[BoxGroup("Group2/Box2")]
|
||||
public Vector3 beta;
|
||||
|
||||
[HorizontalGroup("Group2")]
|
||||
[BoxGroup("Group2/Box2")]
|
||||
public GameObject gamma;
|
||||
```
|
||||
|
||||
| パラメータ | 説明 |
|
||||
| - | - |
|
||||
| GroupPath | グループのパスを指定します。グループは`/`で区切ることでネストすることが可能です。 |
|
23
docs/articles/ja/attributes/horizontal-line.md
Normal file
@ -0,0 +1,23 @@
|
||||
# Horizontal Line Attribute
|
||||
|
||||
Inspectorに仕切り線を追加します。
|
||||
|
||||
![img](../../../images/img-attribute-horizontal-line.png)
|
||||
|
||||
```cs
|
||||
[HorizontalLine]
|
||||
public float foo;
|
||||
|
||||
[HorizontalLine(1f, 0f, 0f)]
|
||||
public Vector2 bar;
|
||||
|
||||
[HorizontalLine(1f, 0.5f, 0f, 0.5f)]
|
||||
public GameObject baz;
|
||||
```
|
||||
|
||||
| パラメータ | 説明 |
|
||||
| - | - |
|
||||
| r | 線の色の赤成分 |
|
||||
| g | 線の色の緑成分 |
|
||||
| b | 線の色の青成分 |
|
||||
| a | 線の色のアルファ値 |
|
20
docs/articles/ja/attributes/indent.md
Normal file
@ -0,0 +1,20 @@
|
||||
# Indent Attribute
|
||||
|
||||
フィールドにインデントを追加します。
|
||||
|
||||
![img](../../../images/img-attribute-indent.png)
|
||||
|
||||
```cs
|
||||
[Indent]
|
||||
public float foo;
|
||||
|
||||
[Indent(2)]
|
||||
public Vector2 bar;
|
||||
|
||||
[Indent(3)]
|
||||
public GameObject baz;
|
||||
```
|
||||
|
||||
| パラメータ | 説明 |
|
||||
| - | - |
|
||||
| Indent | インデントの数 |
|
10
docs/articles/ja/attributes/inline-editor.md
Normal file
@ -0,0 +1,10 @@
|
||||
# Inline Editor Attribute
|
||||
|
||||
対象のScriptableObjectやコンポーネントのInspectorをインラインで表示し、編集が可能になります。
|
||||
|
||||
![img](../../../images/img-attribute-inline-editor.png)
|
||||
|
||||
```cs
|
||||
[InlineEditor]
|
||||
public SampleScriptableObject sample;
|
||||
```
|
30
docs/articles/ja/attributes/label-text.md
Normal file
@ -0,0 +1,30 @@
|
||||
# Label Text Attribute
|
||||
|
||||
フィールドのラベルのテキストを上書きします。
|
||||
|
||||
![img](../../../images/img-attribute-label-text.png)
|
||||
|
||||
```cs
|
||||
[LabelText("FOO!")]
|
||||
public float foo;
|
||||
|
||||
[LabelText("BAR!")]
|
||||
public Vector3 bar;
|
||||
|
||||
[LabelText("BAZ!")]
|
||||
public GameObject baz;
|
||||
|
||||
[Space]
|
||||
[LabelText("α")]
|
||||
public float alpha;
|
||||
|
||||
[LabelText("β")]
|
||||
public Vector3 beta;
|
||||
|
||||
[LabelText("γ")]
|
||||
public GameObject gamma;
|
||||
```
|
||||
|
||||
| パラメータ | 説明 |
|
||||
| - | - |
|
||||
| Text | フィールドのラベルに表示するテキスト |
|
20
docs/articles/ja/attributes/order.md
Normal file
@ -0,0 +1,20 @@
|
||||
# Order Attribute
|
||||
|
||||
フィールドの表示順を変更します。Orderのデフォルト値は0で、メンバーは昇順に表示されます。
|
||||
|
||||
![img](../../../images/img-attribute-order.png)
|
||||
|
||||
```cs
|
||||
[Order(2)]
|
||||
public float foo;
|
||||
|
||||
[Order(1)]
|
||||
public Vector3 bar;
|
||||
|
||||
[Order(0)]
|
||||
public GameObject baz;
|
||||
```
|
||||
|
||||
| パラメータ | 説明 |
|
||||
| - | - |
|
||||
| Order | メンバーの表示順 |
|
19
docs/articles/ja/attributes/read-only.md
Normal file
@ -0,0 +1,19 @@
|
||||
# Read Only Attribute
|
||||
|
||||
フィールドを編集不可能にします。
|
||||
|
||||
![img](../../../images/img-attribute-read-only.png)
|
||||
|
||||
```cs
|
||||
[ReadOnly]
|
||||
public float field = 2.5f;
|
||||
|
||||
[ReadOnly]
|
||||
public int[] array = new int[5];
|
||||
|
||||
[ReadOnly]
|
||||
public SampleClass classField;
|
||||
|
||||
[ReadOnly]
|
||||
public SampleClass[] classArray = new SampleClass[3];
|
||||
```
|
17
docs/articles/ja/attributes/required.md
Normal file
@ -0,0 +1,17 @@
|
||||
# Required Attribute
|
||||
|
||||
フィールドにオブジェクトの参照が割り当てられていない場合に警告を表示します。
|
||||
|
||||
![img](../../../images/img-attribute-required.png)
|
||||
|
||||
```cs
|
||||
[Required]
|
||||
public GameObject requiredField1;
|
||||
|
||||
[Required("Custom message")]
|
||||
public Material requiredField2;
|
||||
```
|
||||
|
||||
| パラメータ | 説明 |
|
||||
| - | - |
|
||||
| Message | 警告に表示するテキスト |
|
28
docs/articles/ja/attributes/show-if.md
Normal file
@ -0,0 +1,28 @@
|
||||
# Show If Attribute
|
||||
|
||||
対象のメンバーのbool値がtrueの場合にのみInspectorに表示されます。
|
||||
|
||||
![img](../../../images/img-attribute-show-if-false.png)
|
||||
|
||||
![img](../../../images/img-attribute-show-if-true.png)
|
||||
|
||||
```cs
|
||||
public bool show;
|
||||
|
||||
public bool Show => show;
|
||||
public bool IsShowTrue() => show;
|
||||
|
||||
[ShowIf("show")]
|
||||
public int showIfField;
|
||||
|
||||
[ShowIf("Show")]
|
||||
public int showIfProperty;
|
||||
|
||||
[ShowIf("IsShowTrue")]
|
||||
public int showIfMethod;
|
||||
```
|
||||
|
||||
|
||||
| パラメータ | 説明 |
|
||||
| - | - |
|
||||
| Condition | 条件の判定に使用するフィールド、プロパティまたはメソッドの名前 |
|
19
docs/articles/ja/attributes/show-in-inspector.md
Normal file
@ -0,0 +1,19 @@
|
||||
# Show In Inspector Attribute
|
||||
|
||||
シリアライズされていないフィールドやプロパティをInspectorから編集可能にします。これらの値はシリアライズされず、変更は保存されないことに留意してください。
|
||||
|
||||
![img](../../../images/img-attribute-show-in-inspector.png)
|
||||
|
||||
```cs
|
||||
[NonSerialized, ShowInInspector]
|
||||
public int field;
|
||||
|
||||
[NonSerialized, ShowInInspector]
|
||||
public SampleClass classField = new();
|
||||
|
||||
[ShowInInspector]
|
||||
public int Getter => 10;
|
||||
|
||||
[field: NonSerialized, ShowInInspector]
|
||||
public string Property { get; set; } = string.Empty;
|
||||
```
|
30
docs/articles/ja/attributes/tab-group.md
Normal file
@ -0,0 +1,30 @@
|
||||
# Tab Group Attribute
|
||||
|
||||
複数のメンバーをタブに分割するグループを作成します。
|
||||
|
||||
![img](../../../images/img-attribute-tab-group.png)
|
||||
|
||||
```cs
|
||||
[TabGroup("Group1", "Tab1")]
|
||||
public float foo;
|
||||
|
||||
[TabGroup("Group1", "Tab2")]
|
||||
public Vector3 bar;
|
||||
|
||||
[TabGroup("Group1", "Tab3")]
|
||||
public GameObject baz;
|
||||
|
||||
[TabGroup("Group1", "Tab1")]
|
||||
public float alpha;
|
||||
|
||||
[TabGroup("Group1", "Tab2")]
|
||||
public Vector3 beta;
|
||||
|
||||
[TabGroup("Group1", "Tab3")]
|
||||
public GameObject gamma;
|
||||
```
|
||||
|
||||
| パラメータ | 説明 |
|
||||
| - | - |
|
||||
| GroupPath | グループのパスを指定します。グループは`/`で区切ることでネストすることが可能です。 |
|
||||
| TabName | メンバーが所属するタブの名前を指定します。 |
|
22
docs/articles/ja/attributes/title.md
Normal file
@ -0,0 +1,22 @@
|
||||
# Title Attribute
|
||||
|
||||
Inspector上に区切り線付きのヘッダーを表示します。
|
||||
|
||||
![img](../../../images/img-attribute-title.png)
|
||||
|
||||
```cs
|
||||
[Title("Title1")]
|
||||
public float foo;
|
||||
public Vector3 bar;
|
||||
public GameObject baz;
|
||||
|
||||
[Title("Title2", "Subtitle")]
|
||||
public float alpha;
|
||||
public Vector3 beta;
|
||||
public GameObject gamma;
|
||||
```
|
||||
|
||||
| パラメータ | 説明 |
|
||||
| - | - |
|
||||
| Title | ヘッダーに表示するテキスト |
|
||||
| Subtitle | タイトルの下に小さく表示されるテキスト |
|
28
docs/articles/ja/attributes/validate-input.md
Normal file
@ -0,0 +1,28 @@
|
||||
# Validate Input Attribute
|
||||
|
||||
指定された名前のメンバーの値がfalseである場合に警告を表示します。
|
||||
|
||||
![img](../../../images/img-attribute-validate-input.png)
|
||||
|
||||
```cs
|
||||
[ValidateInput("IsNotNull")]
|
||||
public GameObject obj;
|
||||
|
||||
[ValidateInput("IsZeroOrGreater", "foo must be 0 or greater.")]
|
||||
public int foo = -1;
|
||||
|
||||
static bool IsNotNull(GameObject go)
|
||||
{
|
||||
return go != null;
|
||||
}
|
||||
|
||||
static bool IsZeroOrGreater(int a)
|
||||
{
|
||||
return a >= 0;
|
||||
}
|
||||
```
|
||||
|
||||
| パラメータ | 説明 |
|
||||
| - | - |
|
||||
| Condition | 値の検証に使用するフィールド、プロパティまたはメソッドの名前 |
|
||||
| Message | 警告に表示するテキスト |
|
16
docs/articles/ja/comparison-with-other-libraries.md
Normal file
@ -0,0 +1,16 @@
|
||||
# 他ライブラリとの比較
|
||||
|
||||
Alchemyは他のエディタ拡張用のアセットと同等、またはそれ以上の非常に豊富な機能を搭載しています。ここではAlchemyと他のアセット/ライブラリの機能の比較を示します。
|
||||
|
||||
| | Alchemy | [Odin Inspector & Serializer](https://odininspector.com/) | [NaughtyAttributes](https://github.com/dbrizov/NaughtyAttributes) | [Tri Inspector](https://github.com/codewriter-packages/Tri-Inspector) | [Unity Editor Toolbox](https://github.com/arimger/Unity-Editor-Toolbox) |
|
||||
| - | - | - | - | - | - |
|
||||
| オープンソース | ✔︎ | ❌ | ✔︎ | ✔︎ | ✔︎ |
|
||||
| グループ化属性 | ✔︎ | ✔︎ | ✔︎ | ✔︎ | ✔︎ |
|
||||
| Button属性 | ✔︎ | ✔︎ | ✔︎ <br>(引数なし) | ✔︎ | ✔︎ <br>(引数なし) |
|
||||
| NonSerializedメンバーの編集 | ✔︎ | ✔︎ | ❌ | ✔︎ | ❌ |
|
||||
| SerializeReference対応 | ✔︎ | ✔︎ | ❌ | ✔︎ | ✔︎ |
|
||||
| シリアル化拡張 | ✔︎ <br>(partialが必要) | ✔︎ <br>(専用型を継承) | ❌ | ❌ | ❌ <br>(シリアル化可能な型の提供) |
|
||||
| UI Toolkit対応 | ✔︎ | ✔︎ | ❌ | ✔︎ | ❌ |
|
||||
| EditorWindow拡張 | ✔︎ | ✔︎ | ❌ | ❌ | ❌ |
|
||||
| Hierarchy拡張 | ✔︎ | ❌ | ❌ | ❌ | ✔︎ |
|
||||
|
@ -1 +0,0 @@
|
||||
# Getting Started
|
2
docs/articles/ja/hierarchy-decoration.md
Normal file
@ -0,0 +1,2 @@
|
||||
# ヒエラルキーの装飾
|
||||
|
40
docs/articles/ja/installation.md
Normal file
@ -0,0 +1,40 @@
|
||||
# インストール
|
||||
|
||||
プロジェクトにAlchemyをインストールして使用を開始しましょう。
|
||||
|
||||
### 要件
|
||||
|
||||
* Unity 2021.2 以上 (シリアル化拡張を使用する場合、2022.1以上を推奨)
|
||||
* Serialization 2.0 以上 (シリアル化拡張を使用する場合)
|
||||
|
||||
### Package Manager経由でインストール (推奨)
|
||||
|
||||
Package Managerを利用してAlchemyをインストールできます。
|
||||
|
||||
1. Window > Package ManagerからPackage Managerを開く
|
||||
2. 「+」ボタン > Add package from git URL
|
||||
3. 以下のURLを入力する
|
||||
|
||||
```text
|
||||
https://github.com/AnnulusGames/Alchemy.git?path=/Alchemy/Assets/Alchemy
|
||||
```
|
||||
|
||||
![img1](../../images/img-setup-1.png)
|
||||
|
||||
あるいはPackages/manifest.jsonを開き、dependenciesブロックに以下を追記します。
|
||||
|
||||
```json
|
||||
{
|
||||
"dependencies": {
|
||||
"com.annulusgames.alchemy": "https://github.com/AnnulusGames/Alchemy.git?path=/Alchemy/Assets/Alchemy"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### unitypackageからインストール
|
||||
|
||||
配布されているunitypackageファイルからAlchemyをインストールすることも可能です。
|
||||
|
||||
1. Releasesから最新のリリースに移動
|
||||
2. unitypackageファイルをダウンロード
|
||||
3. ファイルを開き、プロジェクトにインポートする
|
@ -1 +0,0 @@
|
||||
# Introduction
|
100
docs/articles/ja/quick-start.md
Normal file
@ -0,0 +1,100 @@
|
||||
# クイックスタート
|
||||
|
||||
Inspectorでの表示をカスタマイズしたい場合には、クラスが持つフィールドに属性を付加します。
|
||||
|
||||
```cs
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
using Alchemy.Inspector; // Alchemy.Inspector名前空間をusingに追加
|
||||
|
||||
public class BasicAttributesSample : MonoBehaviour
|
||||
{
|
||||
[LabelText("Custom Label")]
|
||||
public float foo;
|
||||
|
||||
[HideLabel]
|
||||
public Vector3 bar;
|
||||
|
||||
[AssetsOnly]
|
||||
public GameObject baz;
|
||||
|
||||
[Title("Title")]
|
||||
[HelpBox("HelpBox", HelpBoxMessageType.Info)]
|
||||
[ReadOnly]
|
||||
public string message = "Read Only";
|
||||
}
|
||||
```
|
||||
|
||||
![img1](../../images/img1.png)
|
||||
|
||||
各フィールドをグループ化する属性もいくつか用意されています。各グループはスラッシュで区切ることでネストできます。
|
||||
|
||||
```cs
|
||||
using UnityEngine;
|
||||
using Alchemy.Inspector;
|
||||
|
||||
public class GroupAttributesSample : MonoBehaviour
|
||||
{
|
||||
[FoldoutGroup("Foldout")] public int a;
|
||||
[FoldoutGroup("Foldout")] public int b;
|
||||
[FoldoutGroup("Foldout")] public int c;
|
||||
|
||||
[TabGroup("Tab", "Tab1")] public int x;
|
||||
[TabGroup("Tab", "Tab2")] public string y;
|
||||
[TabGroup("Tab", "Tab3")] public Vector3 z;
|
||||
|
||||
[HorizontalGroup("Horizontal")][BoxGroup("Horizontal/Box1")] public float foo;
|
||||
[HorizontalGroup("Horizontal")][BoxGroup("Horizontal/Box1")] public Vector3 bar;
|
||||
[HorizontalGroup("Horizontal")][BoxGroup("Horizontal/Box1")] public GameObject baz;
|
||||
|
||||
[HorizontalGroup("Horizontal")][BoxGroup("Horizontal/Box2")] public float alpha;
|
||||
[HorizontalGroup("Horizontal")][BoxGroup("Horizontal/Box2")] public Vector3 beta;
|
||||
[HorizontalGroup("Horizontal")][BoxGroup("Horizontal/Box2")] public GameObject gamma;
|
||||
}
|
||||
```
|
||||
|
||||
![img2](../../images/img2.png)
|
||||
|
||||
メソッドに`[Button]`属性を付加することで、メソッドをInspectorから実行することが可能になります。
|
||||
|
||||
```cs
|
||||
using System.Text;
|
||||
using UnityEngine;
|
||||
using Alchemy.Inspector;
|
||||
|
||||
[Serializable]
|
||||
public sealed class SampleClass : ISample
|
||||
{
|
||||
public float foo;
|
||||
public Vector3 bar;
|
||||
public GameObject baz;
|
||||
}
|
||||
|
||||
public class ButtonSample : MonoBehaviour
|
||||
{
|
||||
[Button]
|
||||
public void Foo()
|
||||
{
|
||||
Debug.Log("Foo");
|
||||
}
|
||||
|
||||
[Button]
|
||||
public void Foo(int parameter)
|
||||
{
|
||||
Debug.Log("Foo: " + parameter);
|
||||
}
|
||||
|
||||
[Button]
|
||||
public void Foo(SampleClass parameter)
|
||||
{
|
||||
var builder = new StringBuilder();
|
||||
builder.AppendLine();
|
||||
builder.Append("foo = ").AppendLine(parameter.foo.ToString());
|
||||
builder.Append("bar = ").AppendLine(parameter.bar.ToString());
|
||||
builder.Append("baz = ").Append(parameter.baz == null ? "Null" : parameter.baz.ToString());
|
||||
Debug.Log("Foo: " + builder.ToString());
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
![img3](../../images/img3.png)
|
@ -1,4 +1,78 @@
|
||||
- name: Introduction
|
||||
href: introduction.md
|
||||
- name: Getting Started
|
||||
href: getting-started.md
|
||||
- name: Alchemyとは
|
||||
href: about.md
|
||||
- name: インストール
|
||||
href: installation.md
|
||||
- name: クイックスタート
|
||||
href: quick-start.md
|
||||
- name: 属性一覧
|
||||
items:
|
||||
- name: General
|
||||
- name: Assets Only
|
||||
href: attributes/assets-only.md
|
||||
- name: Button
|
||||
href: attributes/button.md
|
||||
- name: Hide Script Field
|
||||
href: attributes/hide-script-field.md
|
||||
- name: Indent
|
||||
href: attributes/indent.md
|
||||
- name: Inline Editor
|
||||
href: attributes/inline-editor.md
|
||||
- name: Order
|
||||
href: attributes/order.md
|
||||
- name: Read Only
|
||||
href: attributes/read-only.md
|
||||
- name: Show In Inspector
|
||||
href: attributes/show-in-inspector.md
|
||||
|
||||
- name: Conditionals
|
||||
- name: Disable If
|
||||
href: attributes/disable-if.md
|
||||
- name: Disable In Edit Mode
|
||||
href: attributes/disable-in-edit-mode.md
|
||||
- name: Disable In Play Mode
|
||||
href: attributes/disable-in-play-mode.md
|
||||
- name: Enable If
|
||||
href: attributes/enable-if.md
|
||||
- name: Hide If
|
||||
href: attributes/hide-if.md
|
||||
- name: Hide In Edit Mode
|
||||
href: attributes/hide-in-edit-mode.md
|
||||
- name: Hide In Play Mode
|
||||
href: attributes/hide-in-play-mode.md
|
||||
- name: Show If
|
||||
href: attributes/show-if.md
|
||||
|
||||
- name: Decorations
|
||||
- name: Blockquote
|
||||
href: attributes/blockquote.md
|
||||
- name: Help Box
|
||||
href: attributes/help-box.md
|
||||
- name: Hide Label
|
||||
href: attributes/hide-label.md
|
||||
- name: Horizontal Line
|
||||
href: attributes/horizontal-line.md
|
||||
- name: Label Text
|
||||
href: attributes/label-text.md
|
||||
- name: Title
|
||||
href: attributes/title.md
|
||||
|
||||
- name: Validation
|
||||
- name: Required
|
||||
href: attributes/required.md
|
||||
- name: Validate Input
|
||||
href: attributes/validate-input.md
|
||||
|
||||
- name: Groups
|
||||
- name: Box Group
|
||||
href: attributes/box-group.md
|
||||
- name: Foldout Group
|
||||
href: attributes/foldout-group.md
|
||||
- name: Group
|
||||
href: attributes/group.md
|
||||
- name: Horizontal Group
|
||||
href: attributes/horizontal-group.md
|
||||
- name: Tab Group
|
||||
href: attributes/tab-group.md
|
||||
|
||||
- name: 他ライブラリとの比較
|
||||
href: comparison-with-other-libraries.md
|
BIN
docs/images/header.png
Normal file
After Width: | Height: | Size: 182 KiB |
BIN
docs/images/img-attribute-assets-only.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
docs/images/img-attribute-blockquote.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
docs/images/img-attribute-box-group.png
Normal file
After Width: | Height: | Size: 45 KiB |
BIN
docs/images/img-attribute-button.png
Normal file
After Width: | Height: | Size: 41 KiB |
BIN
docs/images/img-attribute-disable-if-false.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
docs/images/img-attribute-disable-if-true.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
docs/images/img-attribute-disable-in-edit-mode-editor.png
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
docs/images/img-attribute-disable-in-edit-mode-player.png
Normal file
After Width: | Height: | Size: 7.6 KiB |
BIN
docs/images/img-attribute-disable-in-play-mode-editor.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
docs/images/img-attribute-disable-in-play-mode-player.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
docs/images/img-attribute-enable-if-false.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
docs/images/img-attribute-enable-if-true.png
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
docs/images/img-attribute-foldout-group.png
Normal file
After Width: | Height: | Size: 43 KiB |
BIN
docs/images/img-attribute-group.png
Normal file
After Width: | Height: | Size: 37 KiB |
BIN
docs/images/img-attribute-help-box.png
Normal file
After Width: | Height: | Size: 43 KiB |
BIN
docs/images/img-attribute-hide-if-false.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
docs/images/img-attribute-hide-if-true.png
Normal file
After Width: | Height: | Size: 6.9 KiB |
BIN
docs/images/img-attribute-hide-in-edit-mode-editor.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
docs/images/img-attribute-hide-in-edit-mode-player.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
docs/images/img-attribute-hide-in-play-mode-editor.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
docs/images/img-attribute-hide-in-play-mode-player.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
docs/images/img-attribute-hide-label.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
docs/images/img-attribute-hide-script-field.png
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
docs/images/img-attribute-horizontal-group.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
docs/images/img-attribute-horizontal-line.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
docs/images/img-attribute-indent.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
docs/images/img-attribute-inline-editor.png
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
docs/images/img-attribute-label-text.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
docs/images/img-attribute-order.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
docs/images/img-attribute-read-only.png
Normal file
After Width: | Height: | Size: 112 KiB |
BIN
docs/images/img-attribute-required.png
Normal file
After Width: | Height: | Size: 40 KiB |
BIN
docs/images/img-attribute-show-if-false.png
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
docs/images/img-attribute-show-if-true.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
docs/images/img-attribute-show-in-inspector.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
docs/images/img-attribute-tab-group.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
docs/images/img-attribute-title.png
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
docs/images/img-attribute-validate-input.png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
docs/images/img-setup-1.png
Normal file
After Width: | Height: | Size: 74 KiB |
BIN
docs/images/img1.png
Normal file
After Width: | Height: | Size: 49 KiB |
BIN
docs/images/img2.png
Normal file
After Width: | Height: | Size: 71 KiB |
BIN
docs/images/img3.png
Normal file
After Width: | Height: | Size: 51 KiB |
@ -1,11 +1,11 @@
|
||||
---
|
||||
_layout: landing
|
||||
---
|
||||
# Alchemy
|
||||
|
||||
# This is the **HOMEPAGE**.
|
||||
![header](images/header.png)
|
||||
|
||||
Refer to [Markdown](http://daringfireball.net/projects/markdown/) for how to write markdown files.
|
||||
Alchemy is a library that adds a rich set of editor extensions for Unity. It provides inspector attributes, hierarchy extensions, editor window extensions, serialization extensions using source generators, and more.
|
||||
|
||||
## Quick Start Notes:
|
||||
https://github.com/AnnulusGames/Alchemy
|
||||
|
||||
1. Add images to the *images* folder if the file is referencing an image.
|
||||
### License
|
||||
|
||||
This library is under the [MIT License](https://github.com/AnnulusGames/Alchemy/LICENSE).
|
@ -1,6 +1,6 @@
|
||||
- name: Docs
|
||||
href: en/
|
||||
href: articles/en/
|
||||
- name: Docs (日本語)
|
||||
href: ja/
|
||||
href: articles/ja/
|
||||
- name: API
|
||||
href: api/
|