public static void Create(Transform parent, List <Link.Collision> collisions = null) { GameObject collisionsObject = new GameObject("Collisions"); collisionsObject.transform.SetParentAndAlign(parent); UrdfCollisions urdfCollisions = collisionsObject.AddComponent <UrdfCollisions>(); collisionsObject.hideFlags = HideFlags.NotEditable; urdfCollisions.hideFlags = HideFlags.None; if (collisions != null) { foreach (Link.Collision collision in collisions) { UrdfCollision.Create(urdfCollisions.transform, collision); } } }
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); }
public void AddCorrespondingCollision() { UrdfCollisions collisions = GetComponentInParent <UrdfLink>().GetComponentInChildren <UrdfCollisions>(); UrdfCollision.Create(collisions.transform, geometryType, transform); }