-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1083 from anatawa12/docs-improvements
docs: many improvements
- Loading branch information
Showing
10 changed files
with
187 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
title: Component Scripting API | ||
--- | ||
|
||
# Component Scripting API | ||
|
||
Avatar Optimizer v1.7.0以降、アバターにAvatar Optimizerのコンポーネントを追加・設定するためのComponent APIを提供しています。 | ||
このAPIを使用することで、Avatar Optimizerのコンポーネントを追加するツールやコンポーネントを作成することができます。 | ||
|
||
## Component APIが利用可能なコンポーネント {#supported-components} | ||
|
||
現時点では、すべてのコンポーネントがComponent APIで利用出来るわけではありません。 | ||
Component APIが利用可能なコンポーネントの一覧は以下の通りです。 | ||
|
||
- `RemoveMeshInBox` - コンポーネントの追加と設定変更がサポートされています | ||
- `RemoveMeshByBlendShape` - コンポーネントの追加と設定変更がサポートされています | ||
- `TraceAndOptimize` - デフォルト設定での追加はサポートされていますが、設定変更はサポートされていません | ||
|
||
将来のバージョンで追加されるデフォルトで有効な機能との互換性を保つために、コンポーネントの設定変更を行う場合には注意が必要です。 | ||
詳細については以下のドキュメントを参照してください。 | ||
|
||
## はじめに {#getting-started} | ||
|
||
Component APIを使用するには、assembly definitionファイルで`com.anatawa12.avatar-optimizer.runtime`を参照する必要があります。 | ||
Avatar Optimizerはランタイムで動作しないため、ランタイムビルド向けで`com.anatawa12.avatar-optimizer.runtime`に依存してはいけません。\ | ||
`com.anatawa12.avatar-optimizer.runtime`にあるいくつかのクラスは、将来のバージョンでランタイム向けビルドから除外される可能性があります。 | ||
言い換えると、ランタイム向けのアセンブリで`com.anatawa12.avatar-optimizer.runtime`を使用するのは避けることをお勧めします。エディタ向けのアセンブリでのみ使用するようにしてください。 | ||
|
||
次に、コンポーネントの設定を変更する場合は、将来のバージョンで追加される機能との互換性を確保するために`void Initialize(int version)`メソッドを呼び出す必要があります。 | ||
([動作の安定性](../../basic-concept/#behavior-stability)で説明されているように、)デフォルト設定は変更される可能性があります。\ | ||
デフォルト設定は、`GameObject.AddComponent<T>()`メソッドで追加されるコンポーネントに影響します。 | ||
従って、Avatar Optimizerの将来のバージョンとの互換性を保つためには、使用するデフォルト設定のバージョンを指定して`Initialize`メソッドを呼び出す必要があります。 | ||
デフォルト設定のバージョンは、`Initialize`メソッドのドキュメントに記載されているはずです。\ | ||
`Initialize`メソッドを呼び出さなかった場合、コンポーネントが予期しない動作をしたり、将来的にエラーが発生したりする可能性があります。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
title: Component Scripting API | ||
--- | ||
|
||
# Component Scripting API | ||
|
||
Since Avatar Optimizer v1.7.0, Avatar Optimizer provides Component API to add Avatar Optimizer components to the Avatar. | ||
By using this API, you can create tools or components that add Avatar Optimizer components. | ||
|
||
## Components that supported by Component API {#supported-components} | ||
|
||
Currently, not all components are supported by Component API. | ||
Here is the list of components that are supported by Component API. | ||
|
||
- `RemoveMeshInBox` - Adding and configuring component is supported | ||
- `RemoveMeshByBlendShape` - Adding and configuring component is supported | ||
- `TraceAndOptimize` - Adding with default configuration is supported but configuring is not supported | ||
|
||
For components that supports configuring, to keep compatibility with future features that enabled by default, | ||
you need extra attention for the configuration. See document below for more details. | ||
|
||
## Getting Started | ||
|
||
To use Component API, you have to reference `com.anatawa12.avatar-optimizer.runtime` assembly in your assembly definition file. | ||
Since Avatar Optimizer does not work on the runtime, you should not depends on `com.anatawa12.avatar-optimizer.runtime` assembly for runtime build.\ | ||
We may remove some classes from `com.anatawa12.avatar-optimizer.runtime` on runtime build in the future. | ||
In other words, it's recommended to avoid use of `com.anatawa12.avatar-optimizer.runtime` in runtime assembly, you should use it only in editor assembly. | ||
|
||
Second, If you want to configure components, you have to call `void Initialize(int version)` method to ensure the compatibility with future features. | ||
The default setting of Avatar Optimizer can be changed in the future (as described in [Behavior Stability](../../basic-concept/#behavior-stability)).\ | ||
The default setting of Components will be affected to the components added with `GameObject.AddComponent<T>()` method. | ||
Therefore, to keep behavior compability with future versions, you have to call `Initialize` method with the version of default configuration you want to use. | ||
The default configuration version should be described in the document of the `Initialize` method.\ | ||
Without calling `Initialize` method, component will behave unexpectedly or you may get error in the future. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.