UniVRM/Assets/VRM10/Runtime/FastSpringBone/InputPorts/FastSpringBoneScope.cs
2021-10-06 14:53:39 +09:00

29 lines
808 B
C#

using System;
using System.Collections.Generic;
using UnityEngine;
namespace UniVRM10.FastSpringBones.System
{
/// <summary>
/// 1キャラに対応するFastSpringBoneのスコープ
/// </summary>
public class FastSpringBoneScope : IDisposable
{
private readonly FastSpringBoneService _service;
private readonly FastSpringBoneBuffer _buffer;
public FastSpringBoneScope(IReadOnlyList<FastSpringBoneSpring> springs)
{
_service = FastSpringBoneService.Instance;
_buffer = new FastSpringBoneBuffer(springs);
_service.BufferCombiner.Register(_buffer);
}
public void Dispose()
{
_service.BufferCombiner.Unregister(_buffer);
_buffer.Dispose();
}
}
}