enabled = false. not updateWhenOffscreen

This commit is contained in:
ousttrue
2021-09-28 16:54:34 +09:00
parent c610dbb765
commit 03bb4201bf
3 changed files with 64 additions and 1 deletions

View File

@@ -10,7 +10,10 @@ namespace VRMShaders
/// この interface を実装するクラスは、利用後に破棄すべき UnityObject を保持する可能性があるので
/// Dispose により解放すること。
///
/// TransferOwnership により、破棄責任を移譲することができる。
/// [Runtime] TransferOwnership により、破棄責任を RuntimeGltfInstance に移譲する。
/// RuntimeGltfInstance.OnDestroy でこれを破棄する。
/// [Editor] TransferOwnership により、Asset化して破棄しない
/// DestroyするとAssetが消えてしまう。
///
/// </summary>
public interface IResponsibilityForDestroyObjects : IDisposable

View File

@@ -0,0 +1,53 @@
# Runtime のリソース管理について
Runtime Import で `Texture`, `Material`, `Mesh` などのリソースを Root の `GameObject.OnDestroy`
と同時に `UnityEngine.Object.Destroy` したい。
## RuntimeGltfInstance
`RuntimeGltfInstance.OnDestroy` で破棄を実行するようにした。
```
ImporterContext
[Own]List<Mesh>
AnimationClipFactory[Own]List<Animation>
TextureFactory[Own]List<Texture>
MaterialFactory[Own]List<Material>
👇 ImporterContext.LoadAsync
RuntimeGltfInstance.AttachTo
ImporterContext.TransferOwnership
RuntimeGltfInstance
[Own]List<Mesh>
[Own]List<Animation>
[Own]List<Texture>
[Own]List<Material>
```
> VRM-0.X では `RuntimeGltfInstance` にリソースを委譲している。
## Vrm10Instance
```
Vrm10Importer
[Own]HumanoidAvatar
[Own]Vrm10Object
[Own]List<Vrm10Expression>
👇 Vrm10Importer.LoadAsync
RuntimeGltfInstance
[Own]HumanoidAvatar
[Own]VrmObject
[Own]List<VrmExpression>
```
### FirstPerson
```
👇 Vrm10Instance.FirstPerson.SetupAsync
RuntimeGltfInstance
[Own]List<Mesh>.Add(headless)
```

View File

@@ -37,6 +37,13 @@ vrm0/0_58_blendshape.md
vrm0/firstperson.md
```
## 実装メモ
```{toctree}
implementation/runtime_resource_management.md
```
### Samples
- SimpleViewer