UnityEditor.PackageInfo.GetPackageList C# (CSharp) Method

GetPackageList() private method

private GetPackageList ( ) : UnityEditor.PackageInfo[]
return UnityEditor.PackageInfo[]
        internal static extern PackageInfo[] GetPackageList();
    }

Usage Example

        public static bool OpenPackageInternal(string id)
        {
            Match match = AssetStoreContext.s_GeneratedIDRegExp.Match(id);

            if (match.Success && File.Exists(match.Groups[1].Value))
            {
                AssetDatabase.ImportPackage(match.Groups[1].Value, true);
                return(true);
            }
            foreach (PackageInfo package in PackageInfo.GetPackageList())
            {
                if (package.jsonInfo != string.Empty)
                {
                    JSONValue jsonValue = JSONParser.SimpleParse(package.jsonInfo);
                    string    str       = !jsonValue.Get("id").IsNull() ? jsonValue["id"].AsString(true) : (string)null;
                    if (str != null && str == id && File.Exists(package.packagePath))
                    {
                        AssetDatabase.ImportPackage(package.packagePath, true);
                        return(true);
                    }
                }
            }
            Debug.LogError((object)("Unknown package ID " + id));
            return(false);
        }
All Usage Examples Of UnityEditor.PackageInfo::GetPackageList
PackageInfo