Beispiel #1
0
        public static GameObject Create(this Robot robot)
        {
            if (UrdfAssetDatabase.GetAssetParentDirectoryPath(robot.filename) == null)
            {
                Debug.LogError("URDF file and ressources must be placed in Assets Folder:\n" + Application.dataPath);
                return(null);
            }

            UrdfAssetDatabase.Initialize(robot);

            GameObject gameObject = new GameObject(robot.name);

            robot.root.Create(gameObject);

            GameObjectUtility.SetParentAndAlign(gameObject, Selection.activeObject as GameObject);
            Undo.RegisterCreatedObjectUndo(gameObject, "Create " + gameObject.name);
            Selection.activeObject = gameObject;

            setKinematic(gameObject, true);

            return(gameObject);
        }