void OnSelectionChange() { if (Daz3DDTUImporter.ValidateDTUSelected()) { CurrentToolbarMode = ToolbarMode.Commands; } _needsRepaint = true; }
private void DrawCommands() { GUIStyle bigStyle = new GUIStyle(GUI.skin.button); bigStyle.fontSize = 14; bigStyle.normal.textColor = ThemedColor; bigStyle.padding = new RectOffset(24, 24, 12, 12); bigStyle.margin = new RectOffset(12, 12, 12, 12); if (CommandButton("Clear History", bigStyle)) { Daz3DDTUImporter.EmptyEventQueue(); } if (Daz3DDTUImporter.ValidateDTUSelected()) { var dtu = Selection.activeObject; //the button if (CommandButton("Create Unity Prefab from '" + dtu.name + ".dtu'", bigStyle)) { var dtuPath = AssetDatabase.GetAssetPath(dtu); var fbxPath = dtuPath.Replace(".dtu", ".fbx"); Daz3DDTUImporter.Import(dtuPath, fbxPath); } if (CommandButton("Extract Materials from '" + dtu.name + ".dtu'", bigStyle)) { DTUConverter.MenuItemConvert(); } } else { GUILayout.Space(12); GUILayout.Label("Select a DTU file in project window for more commands..."); } }