mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-08-22 02:24:57 -05:00
rm fastSpringBoneScope
This commit is contained in:
@@ -14,7 +14,8 @@ namespace UniVRM10
|
||||
private readonly Vrm10Instance m_target;
|
||||
private readonly VRM10Constraint[] m_constraints;
|
||||
private readonly Transform m_head;
|
||||
private readonly FastSpringBoneScope m_fastSpringBoneScope;
|
||||
private readonly FastSpringBoneService m_fastSpringBoneService;
|
||||
private readonly FastSpringBoneBuffer m_fastSpringBoneBuffer;
|
||||
|
||||
public Vrm10InstanceRuntime(Vrm10Instance target)
|
||||
{
|
||||
@@ -34,12 +35,15 @@ namespace UniVRM10
|
||||
m_constraints = target.GetComponentsInChildren<VRM10Constraint>();
|
||||
}
|
||||
|
||||
m_fastSpringBoneScope = CreateFastSpringBoneScheduler(m_target.SpringBone);
|
||||
m_fastSpringBoneService = FastSpringBoneService.Instance;
|
||||
m_fastSpringBoneBuffer = CreateFastSpringBoneBuffer(m_target.SpringBone);
|
||||
|
||||
m_fastSpringBoneService.BufferCombiner.Register(m_fastSpringBoneBuffer);
|
||||
}
|
||||
|
||||
private FastSpringBoneScope CreateFastSpringBoneScheduler(Vrm10InstanceSpringBone springBone)
|
||||
private FastSpringBoneBuffer CreateFastSpringBoneBuffer(Vrm10InstanceSpringBone springBone)
|
||||
{
|
||||
return new FastSpringBoneScope(
|
||||
return new FastSpringBoneBuffer(
|
||||
springBone.Springs.Select(spring => new FastSpringBoneSpring
|
||||
{
|
||||
center = m_target.SpringBoneCenter,
|
||||
@@ -117,7 +121,8 @@ namespace UniVRM10
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
m_fastSpringBoneScope.Dispose();
|
||||
m_fastSpringBoneService.BufferCombiner.Unregister(m_fastSpringBoneBuffer);
|
||||
m_fastSpringBoneBuffer.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3531a1098413408f8abf2d7f5f8adca0
|
||||
timeCreated: 1633328902
|
||||
Reference in New Issue
Block a user