private void OnInspectorUpdate()
        {
            // some methods can only be called from main thread:
            // We check the status to call the methods at the right step in the process:

            Repaint();

            // import Model
            if (status["databaseRefreshed"].WaitOne(0) && !status["importModelDialogShown"].WaitOne(0))
            {
                status["importModelDialogShown"].Set();
                if (EditorUtility.DisplayDialog(
                        "Urdf Assets imported.",
                        "Do you want to generate a " + urdfImporter.robotName + " GameObject now?",
                        "Yes", "No"))
                {
                    RobotCreator.Create(Path.Combine(urdfImporter.LocalDirectory, "robot_description.urdf"));
                }
            }

            // refresh Asset Database
            if (status["resourceFilesReceived"].WaitOne(0) && !status["databaseRefreshed"].WaitOne(0))
            {
                status["databaseRefreshStarted"].Set();
                AssetDatabase.Refresh();
                status["databaseRefreshed"].Set();
            }
        }
Пример #2
0
        private static void CreateUrdfObject()
        {
            string urdfFile = EditorUtility.OpenFilePanel(
                "Import local URDF",
                Path.Combine(Path.GetDirectoryName(Application.dataPath), "Assets"),
                "urdf");

            if (urdfFile != "")
            {
                RobotCreator.Create(urdfFile);
            }
        }
Пример #3
0
        private static void CreateUrdfObject()
        {
            string urdfFile = EditorUtility.OpenFilePanel("Generate Urdf Model",
                                                          Path.Combine(
                                                              Path.GetDirectoryName(Application.dataPath),
                                                              Path.Combine("Assets", "Urdf")
                                                              ),
                                                          "urdf;*.urdf");

            if (urdfFile != "")
            {
                RobotCreator.Create(urdfFile);
            }
        }