public static void Create(Transform parent, List <Link.Visual> visuals = null) { GameObject visualsObject = new GameObject("Visuals"); visualsObject.transform.SetParentAndAlign(parent); UrdfVisuals urdfVisuals = visualsObject.AddComponent <UrdfVisuals>(); visualsObject.hideFlags = HideFlags.NotEditable; urdfVisuals.hideFlags = HideFlags.None; if (visuals != null) { foreach (Link.Visual visual in visuals) { UrdfVisual.Create(urdfVisuals.transform, visual); } } }
public static UrdfLink Create(Transform parent, Link link = null, Joint joint = null) { GameObject linkObject = new GameObject("link"); linkObject.transform.SetParentAndAlign(parent); UrdfLink urdfLink = linkObject.AddComponent <UrdfLink>(); UrdfVisuals.Create(linkObject.transform, link?.visuals); UrdfCollisions.Create(linkObject.transform, link?.collisions); if (link != null) { urdfLink.ImportLinkData(link, joint); } else { UrdfInertial.Create(linkObject); EditorGUIUtility.PingObject(linkObject); } return(urdfLink); }