mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-20 01:37:59 -05:00
AnimationClip
This commit is contained in:
parent
09c79cb8eb
commit
bf480a600d
|
|
@ -66,6 +66,12 @@ namespace UniGLTF
|
|||
ctx.AddObjectToAsset(mesh.name, mesh);
|
||||
}
|
||||
|
||||
// Animation
|
||||
foreach (var clip in context.AnimationClips)
|
||||
{
|
||||
ctx.AddObjectToAsset(clip.name, clip);
|
||||
}
|
||||
|
||||
// Root
|
||||
ctx.AddObjectToAsset(context.Root.name, context.Root);
|
||||
ctx.SetMainObject(context.Root);
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ namespace UniGLTF
|
|||
enum Tabs
|
||||
{
|
||||
Model,
|
||||
Animation,
|
||||
Materials,
|
||||
}
|
||||
static Tabs s_currentTab;
|
||||
|
|
@ -29,12 +30,18 @@ namespace UniGLTF
|
|||
public override void OnInspectorGUI()
|
||||
{
|
||||
s_currentTab = MeshUtility.TabBar.OnGUI(s_currentTab);
|
||||
GUILayout.Space(10);
|
||||
|
||||
switch (s_currentTab)
|
||||
{
|
||||
case Tabs.Model:
|
||||
base.OnInspectorGUI();
|
||||
break;
|
||||
|
||||
case Tabs.Animation:
|
||||
OnGUIAnimation(m_importer, m_parser);
|
||||
break;
|
||||
|
||||
case Tabs.Materials:
|
||||
OnGUIMaterial(m_importer, m_parser);
|
||||
break;
|
||||
|
|
@ -103,5 +110,13 @@ namespace UniGLTF
|
|||
}
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
|
||||
static void OnGUIAnimation(GltfScriptedImporter importer, GltfParser parser)
|
||||
{
|
||||
foreach (var a in parser.GLTF.animations)
|
||||
{
|
||||
GUILayout.Label(a.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user