mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-07-02 00:10:58 -05:00
avoid editor error if not playing
This commit is contained in:
parent
759204388f
commit
ceed241abd
|
|
@ -35,6 +35,7 @@ namespace UniVRM10
|
|||
if (!Application.isPlaying)
|
||||
{
|
||||
EditorGUILayout.HelpBox("Enable when playing", MessageType.Info);
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_sliders != null)
|
||||
|
|
|
|||
|
|
@ -43,23 +43,17 @@ namespace UniVRM10
|
|||
|
||||
int m_debugCount;
|
||||
|
||||
internal void Setup(Transform transform, ILookAtEyeDirectionProvider eyeDirectionProvider, ILookAtEyeDirectionApplicable eyeDirectionApplicable)
|
||||
internal void Setup(VRM10Controller target, ILookAtEyeDirectionProvider eyeDirectionProvider, ILookAtEyeDirectionApplicable eyeDirectionApplicable)
|
||||
{
|
||||
m_expressionAvatar = transform.GetComponent<VRM10ExpressionAvatar>();
|
||||
m_expressionAvatar = target.GetComponent<VRM10ExpressionAvatar>();
|
||||
if (m_expressionAvatar == null)
|
||||
{
|
||||
#if VRM_DEVELOP
|
||||
if (m_debugCount++ == 0)
|
||||
{
|
||||
Debug.LogWarning($"{nameof(VRM10ControllerExpression)}.{nameof(m_expressionAvatar)} is null.");
|
||||
}
|
||||
#endif
|
||||
return;
|
||||
throw new ArgumentNullException();
|
||||
}
|
||||
|
||||
Restore();
|
||||
|
||||
_merger = new ExpressionMerger(m_expressionAvatar.Clips, transform);
|
||||
_merger = new ExpressionMerger(m_expressionAvatar.Clips, target.transform);
|
||||
_keys = m_expressionAvatar.Clips.Select(ExpressionKey.CreateFromClip).ToList();
|
||||
var oldInputWeights = _inputWeights;
|
||||
_inputWeights = _keys.ToDictionary(x => x, x => 0f);
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace UniVRM10
|
|||
}
|
||||
m_head = animator.GetBoneTransform(HumanBodyBones.Head);
|
||||
target.LookAt.Setup(animator, m_head);
|
||||
target.Expression.Setup(target.transform, target.LookAt, target.LookAt.EyeDirectionApplicable);
|
||||
target.Expression.Setup(target, target.LookAt, target.LookAt.EyeDirectionApplicable);
|
||||
|
||||
if (m_constraints == null)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user