mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-03-23 02:44:37 -05:00
27 lines
691 B
C#
27 lines
691 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace VRM
|
|
{
|
|
/// <summary>
|
|
/// FastSpringBoneに関連して、特定のGameObjectと紐付いたIDisposableの破棄を担当するクラス
|
|
/// </summary>
|
|
public sealed class FastSpringBoneDisposer : MonoBehaviour
|
|
{
|
|
private readonly List<IDisposable> _disposables = new List<IDisposable>();
|
|
|
|
public void Add(IDisposable disposable)
|
|
{
|
|
_disposables.Add(disposable);
|
|
}
|
|
|
|
private void OnDestroy()
|
|
{
|
|
foreach (var disposable in _disposables)
|
|
{
|
|
disposable.Dispose();
|
|
}
|
|
}
|
|
}
|
|
} |