AnimationClip

This commit is contained in:
ousttrue 2021-02-25 12:53:30 +09:00
parent 09c79cb8eb
commit bf480a600d
2 changed files with 21 additions and 0 deletions

View File

@ -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);

View File

@ -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);
}
}
}
}