public static UrdfCollisions 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) { UrdfCollisionExtensions.Create(urdfCollisions.transform, collision); } } return(urdfCollisions); }
public static void AddCorrespondingCollision(this UrdfVisual urdfVisual) { UrdfCollisions collisions = urdfVisual.GetComponentInParent <UrdfLink>().GetComponentInChildren <UrdfCollisions>(); UrdfCollisionExtensions.Create(collisions.transform, urdfVisual.geometryType, urdfVisual.transform); }