mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-01-06 14:45:06 +08:00
d998763fbe
* feat: add material switcher Also refactor everything... * refactor: simplify object curve handling * refactor: additional refactoring and bugfixes * feat: inverse mode * feat: add material setter inspector UI * chore: set material setter icon * chore: fix error on build * chore: adjust order of inverted element
41 lines
1.0 KiB
C#
41 lines
1.0 KiB
C#
#region
|
|
|
|
using System;
|
|
using UnityEditor;
|
|
using UnityEditor.UIElements;
|
|
using UnityEngine;
|
|
using UnityEngine.UIElements;
|
|
|
|
#endregion
|
|
|
|
namespace nadena.dev.modular_avatar.core.editor.ShapeChanger
|
|
{
|
|
[CustomEditor(typeof(ModularAvatarMaterialSetter))]
|
|
public class MaterialSetterEditor : MAEditorBase
|
|
{
|
|
[SerializeField] private StyleSheet uss;
|
|
[SerializeField] private VisualTreeAsset uxml;
|
|
|
|
|
|
protected override void OnInnerInspectorGUI()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
protected override VisualElement CreateInnerInspectorGUI()
|
|
{
|
|
var root = uxml.CloneTree();
|
|
Localization.UI.Localize(root);
|
|
root.styleSheets.Add(uss);
|
|
|
|
root.Bind(serializedObject);
|
|
|
|
var listView = root.Q<ListView>("Shapes");
|
|
|
|
listView.showBoundCollectionSize = false;
|
|
listView.virtualizationMethod = CollectionVirtualizationMethod.DynamicHeight;
|
|
|
|
return root;
|
|
}
|
|
}
|
|
} |