-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathPackage.cs
More file actions
64 lines (57 loc) · 1.97 KB
/
Copy pathPackage.cs
File metadata and controls
64 lines (57 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//
// Addressables Build Layout Explorer for Unity. Copyright (c) 2021-2026 Peter Schraut (www.console-dev.de). See LICENSE.md
// https://github.com/pschraut/UnityAddressablesBuildLayoutExplorer
//
using UnityEditor;
using UnityEngine;
using UnityEditor.IMGUI.Controls;
using System.Collections.Generic;
namespace Oddworm.EditorFramework.BuildLayoutExplorer
{
/// <summary>
/// Can be used to read a package.json file.
/// </summary>
[System.Serializable]
public class Package
{
// The asset guid of the package.json file
public const string k_PackageAssetGUID = "e16fc46ee80b02e41bcc2e8044634698";
public string name = "";
public string version = "0.0.0";
public string displayName = "Addressables BuildLayout Explorer";
public string description = "";
public string unity = "";
public string documentationUrl = "https://github.com/pschraut/UnityAddressablesBuildLayoutExplorer";
public List<string> keywords = new List<string>();
public Author author = new Author();
public Repository repository = new Repository();
[System.Serializable]
public class Author
{
public string name = "";
public string url = "";
}
[System.Serializable]
public class Repository
{
public string type = "git";
public string url = "https://github.com/pschraut/UnityAddressablesBuildLayoutExplorer.git";
}
public static Package Load()
{
Package value = null;
try
{
var assetPath = AssetDatabase.GUIDToAssetPath(k_PackageAssetGUID);
var json = System.IO.File.ReadAllText(assetPath);
value = JsonUtility.FromJson<Package>(json);
}
finally
{
if (value == null)
value = new Package();
}
return value;
}
}
}