UObjectBaseUtility::IsInPackage

Returns true if the object is contained in the specified package.