Added BlendShapeProxy.SetValues

This commit is contained in:
ousttrue
2018-07-24 21:11:32 +09:00
parent 52b0cd18d5
commit 35c8f821b0
2 changed files with 30 additions and 1 deletions

View File

@@ -129,6 +129,15 @@ namespace VRM
m_materialValueMap.Clear();
}
public void SetValues(IEnumerable<KeyValuePair<BlendShapeKey, float>> values)
{
foreach(var kv in values)
{
SetValue(kv.Key, kv.Value, false);
}
Apply();
}
public void SetValue(BlendShapeKey key, float value, bool replace)
{
m_valueMap[key] = value;

View File

@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using UnityEngine;
@@ -52,13 +53,32 @@ namespace VRM
{
return GetValue(new BlendShapeKey(key));
}
public void SetValue(BlendShapeKey key, float value, bool apply = true)
[Obsolete("Use SetValues")]
public void SetValue(BlendShapeKey key, float value, bool apply)
{
if (m_merger != null)
{
m_merger.SetValue(key, value, apply);
}
}
public void SetValue(BlendShapeKey key, float value)
{
if (m_merger != null)
{
m_merger.SetValue(key, value, true);
}
}
public void SetValues(IEnumerable<KeyValuePair<BlendShapeKey, float>> values)
{
if (m_merger != null)
{
m_merger.SetValues(values);
}
}
public float GetValue(BlendShapeKey key)
{
if (m_merger == null)