UniVRM/Assets/VRM10/Editor/Components/Expression/ExpressionSlider.cs
ousttrue 3f09717236
Feature10/spring bone editor (#994)
* SceneView switch

* VRM10ControllerEditor を分割

* VRM10/Editor/Components/VRM10ControllerSceneView.cs

* LookAtEditor, SpringBoneEditor

* VRM10SpringBoneColliderGroup and VRM10SpringBone to VRM10ControllerSpringBone. not MonoBehaviour

* ReorderableList

* VRM10Window.cs

* SpringBoneTreeView

* ScrollView

* rename

* VRM10SpringBoneColliderEditor

* SelectedGUIBase

* spring name

* VRM10SpringBoneCollider gizmo to handle

* SelectedGUI

* 再度、VRM10SpringBoneColliderGroup を MonoBehaviour へ。SerializedObject の参照の都合
2021-06-01 16:00:49 +09:00

29 lines
840 B
C#

using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace UniVRM10
{
public class ExpressionSlider
{
Dictionary<ExpressionKey, float> m_expressionKeys;
ExpressionKey m_key;
public ExpressionSlider(Dictionary<ExpressionKey, float> expressionKeys, ExpressionKey key)
{
m_expressionKeys = expressionKeys;
m_key = key;
}
public KeyValuePair<ExpressionKey, float> Slider()
{
var oldValue = m_expressionKeys[m_key];
var enable = GUI.enabled;
GUI.enabled = Application.isPlaying;
var newValue = EditorGUILayout.Slider(m_key.ToString(), oldValue, 0, 1.0f);
GUI.enabled = enable;
return new KeyValuePair<ExpressionKey, float>(m_key, newValue);
}
}
}