예제 #1
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            if (_target != target)
            {
                ResetEditor();
            }

            EditorGUILayout.ObjectField(_propBlendShapeAvatar);

            if (_target.bindings != null)
            {
                int index = 0;
                foreach (var binding in _target.bindings)
                {
                    using (new EditorGUILayout.HorizontalScope()) {
                        EditorGUILayout.LabelField(binding.key.Name);
                        EditorGUILayout.LabelField(binding.key.Preset.ToString(), GUILayout.Width(100));

                        _target.bindings[index].value = EditorGUILayout.Slider(binding.value, 0, 1);
                        using (new EditorGUI.DisabledScope(VMCLayerdBlendShapeProxy.HasPresetLayer(binding.key.Preset))) {
                            _target.bindings[index].layer = EditorGUILayout.IntField(binding.layer, GUILayout.Width(24));
                        }
                        _target.CalcurateWeights(index);
                    }
                    index++;
                }
            }

            serializedObject.ApplyModifiedProperties();

            //base.OnInspectorGUI ();
        }
예제 #2
0
 private void ResetEditor()
 {
     _target = target as VMCLayerdBlendShapeProxy;
     _propBlendShapeAvatar = serializedObject.FindProperty("blendShapeAvatar");
     _empty = new GUIContent();
 }