Move AIUEO to UniVRMTest

This commit is contained in:
ousttrue 2018-11-01 16:02:01 +09:00
parent 04a1abab4e
commit cb905a7755
2 changed files with 0 additions and 86 deletions

View File

@ -1,73 +0,0 @@
using System.Collections;
using UnityEngine;
namespace VRM
{
public class AIUEO : MonoBehaviour
{
[SerializeField]
public VRMBlendShapeProxy BlendShapes;
private void Reset()
{
BlendShapes = GetComponent<VRMBlendShapeProxy>();
}
Coroutine m_coroutine;
[SerializeField]
float m_wait = 0.5f;
private void Awake()
{
if (BlendShapes == null) BlendShapes = GetComponent<VRM.VRMBlendShapeProxy>();
if (BlendShapes == null) return;
if (BlendShapes.BlendShapeAvatar == null) return;
var avatar = BlendShapes.BlendShapeAvatar;
}
IEnumerator RoutineNest(BlendShapePreset preset, float velocity, float wait)
{
for (var value = 0.0f; value <= 1.0f; value += velocity)
{
BlendShapes.SetValue(preset, value);
yield return null;
}
BlendShapes.SetValue(preset, 1.0f);
yield return new WaitForSeconds(wait);
for (var value = 1.0f; value >= 0; value -= velocity)
{
BlendShapes.SetValue(preset, value);
yield return null;
}
BlendShapes.SetValue(preset, 0);
yield return new WaitForSeconds(wait * 2);
}
IEnumerator Routine()
{
while (true)
{
yield return new WaitForSeconds(1.0f);
var velocity = 0.1f;
yield return RoutineNest(BlendShapePreset.A, velocity, m_wait);
yield return RoutineNest(BlendShapePreset.I, velocity, m_wait);
yield return RoutineNest(BlendShapePreset.U, velocity, m_wait);
yield return RoutineNest(BlendShapePreset.E, velocity, m_wait);
yield return RoutineNest(BlendShapePreset.O, velocity, m_wait);
}
}
private void OnEnable()
{
m_coroutine = StartCoroutine(Routine());
}
private void OnDisable()
{
StopCoroutine(m_coroutine);
}
}
}

View File

@ -1,13 +0,0 @@
fileFormatVersion: 2
guid: b62ca4f3096cada41938f18e4a02d8dc
timeCreated: 1517463794
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: