Skip to content

Commit 2c56b22

Browse files
committed
Remove dependencies with AssetBundleBrowser and Addressables/Fix Issue that Addressable Builders can't set first Builder Script.
1 parent 8cbe5aa commit 2c56b22

15 files changed

+110
-24
lines changed

Editor/GUI/GroupView/GroupViewController.cs

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
using UnityEditor;
22
using UnityEditor.IMGUI.Controls;
3-
using UnityEditor.AddressableAssets;
4-
53
using System;
64
using System.Collections.Generic;
75
using System.Text.RegularExpressions;
86

97
using Model=UnityEngine.AssetGraph.DataModel.Version2;
108

9+
#if ADDRESSABLES_1_6_OR_NEWER
10+
using UnityEditor.AddressableAssets;
11+
#endif
12+
1113
namespace UnityEngine.AssetGraph {
1214

1315
[Serializable]
@@ -132,6 +134,7 @@ public void OnGroupViewGUI() {
132134
EditorGUILayout.HelpBox(selectedAsset, MessageType.None);
133135
}
134136

137+
#if ADDRESSABLES_1_6_OR_NEWER
135138
if (m_selectedAsset != null) {
136139
var aaSettings = AddressableAssetSettingsDefaultObject.GetSettings(false);
137140
if (aaSettings != null) {
@@ -145,6 +148,7 @@ public void OnGroupViewGUI() {
145148
}
146149
}
147150
}
151+
#endif
148152
}
149153

150154
public void ReloadAndSelect() {

Editor/Integration/AssetBundles-Browser/GraphToolABDataSource.cs

+6-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
*
44
* This code will setup the output of the graph tool to be viewable in the browser.
55
*
6-
* AssetBundles-Browser Available at:
7-
* https://github.com/Unity-Technologies/AssetBundles-Browser
6+
* AssetBundles-Browser is available from Unity Package Manager.
87
*/
9-
8+
9+
#if ASSETBUNDLEBROWSER_1_7_OR_NEWER
10+
1011
using UnityEditor;
1112
using Model = UnityEngine.AssetGraph.DataModel.Version2;
1213
using System;
@@ -140,3 +141,5 @@ public bool BuildAssetBundles (AssetBundleBrowser.AssetBundleDataSource.ABBuildI
140141
}
141142
}
142143
}
144+
145+
#endif

Editor/System/Model/SerializableGroups.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public void Remove (string groupName) {
9595
public Dictionary<string, List<AssetReference>> ToGroupDictionary() {
9696
Dictionary<string, List<AssetReference>> dic = new Dictionary<string, List<AssetReference>>();
9797
foreach(var g in m_groups) {
98-
dic [g.name] = g.assets.Select(a => AssetReferenceDatabase.GetReference(a)).ToList();
98+
dic [g.name] = g.assets.Select(AssetReferenceDatabase.GetReference).ToList();
9999
}
100100
return dic;
101101
}

Editor/System/Node/Addressables.meta

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Editor/System/Node/Buitin/AddressableAssetAddress.cs Editor/System/Node/Addressables/AddressableAssetAddress.cs

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/**
2+
* Addressable integration
3+
*
4+
* This code will add features for Addressables System.
5+
*
6+
* Addressables System is available from Unity Package Manager.
7+
*/
8+
9+
#if ADDRESSABLES_1_6_OR_NEWER
110

211
using System;
312
using System.Linq;
@@ -190,4 +199,6 @@ private void ConfigureAddress (IEnumerable<PerformGraph.AssetGroups> incoming)
190199
}
191200
}
192201
}
193-
}
202+
}
203+
204+
#endif

Editor/System/Node/Buitin/AddressableAssetAddress.cs.meta Editor/System/Node/Addressables/AddressableAssetAddress.cs.meta

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Editor/System/Node/Buitin/AddressableAssetGroup.cs Editor/System/Node/Addressables/AddressableAssetGroup.cs

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/**
2+
* Addressable integration
3+
*
4+
* This code will add features for Addressables System.
5+
*
6+
* Addressables System is available from Unity Package Manager.
7+
*/
8+
9+
#if ADDRESSABLES_1_6_OR_NEWER
110

211
using System;
312
using System.Linq;
@@ -169,4 +178,6 @@ private void ConfigureGroup (IEnumerable<PerformGraph.AssetGroups> incoming)
169178
}
170179
}
171180
}
172-
}
181+
}
182+
183+
#endif

Editor/System/Node/Buitin/AddressableAssetGroup.cs.meta Editor/System/Node/Addressables/AddressableAssetGroup.cs.meta

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Editor/System/Node/Buitin/AddressableAssetLabel.cs Editor/System/Node/Addressables/AddressableAssetLabel.cs

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/**
2+
* Addressable integration
3+
*
4+
* This code will add features for Addressables System.
5+
*
6+
* Addressables System is available from Unity Package Manager.
7+
*/
8+
9+
#if ADDRESSABLES_1_6_OR_NEWER
110

211
using System;
312
using System.Linq;
@@ -173,4 +182,6 @@ public override void Build (BuildTarget target,
173182
}
174183
}
175184
}
176-
}
185+
}
186+
187+
#endif

Editor/System/Node/Buitin/AddressableAssetLabel.cs.meta Editor/System/Node/Addressables/AddressableAssetLabel.cs.meta

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Editor/System/Node/Buitin/AddressableBuilder.cs Editor/System/Node/Addressables/AddressableBuilder.cs

+14-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
/**
2+
* Addressable integration
3+
*
4+
* This code will add features for Addressables System.
5+
*
6+
* Addressables System is available from Unity Package Manager.
7+
*/
8+
9+
#if ADDRESSABLES_1_6_OR_NEWER
10+
111
using UnityEditor;
212

313
using System;
@@ -110,8 +120,8 @@ public override void OnInspectorGUI(NodeGUI node, AssetReferenceStreamManager st
110120
}
111121

112122
var dataBuilders = Settings.DataBuilders.Where(builder => (builder as IDataBuilder).CanBuildData<AddressablesPlayerBuildResult>()).ToList();
113-
114-
var builderIndex = m_currentDataBuilder == null ? 0 : dataBuilders.IndexOf(m_currentDataBuilder);
123+
124+
var builderIndex = m_currentDataBuilder == null ? -1 : dataBuilders.IndexOf(m_currentDataBuilder);
115125
var builderNames = dataBuilders
116126
.Select(builder => ((IDataBuilder) builder).Name).ToArray();
117127

@@ -279,3 +289,5 @@ public override void Build(BuildTarget target,
279289
}
280290
}
281291
}
292+
293+
#endif

Editor/System/Node/Buitin/AddressableBuilder.cs.meta Editor/System/Node/Addressables/AddressableBuilder.cs.meta

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Editor/Unity.AssetGraph.Editor.asmdef

+13-1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,17 @@
1717
"precompiledReferences": [],
1818
"autoReferenced": true,
1919
"defineConstraints": [],
20-
"versionDefines": []
20+
"versionDefines": [
21+
{
22+
"name": "com.unity.assetbundlebrowser",
23+
"expression": "1.7.0",
24+
"define": "ASSETBUNDLEBROWSER_1_7_OR_NEWER"
25+
},
26+
{
27+
"name": "com.unity.addressables",
28+
"expression": "1.6.0",
29+
"define": "ADDRESSABLES_1_6_OR_NEWER"
30+
}
31+
],
32+
"noEngineReferences": false
2133
}

Runtime/Unity.AssetGraph.asmdef

+20-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,23 @@
22
"name": "Unity.AssetGraph",
33
"references": [],
44
"includePlatforms": [],
5-
"excludePlatforms": []
6-
}
5+
"excludePlatforms": [],
6+
"allowUnsafeCode": false,
7+
"overrideReferences": false,
8+
"precompiledReferences": [],
9+
"autoReferenced": true,
10+
"defineConstraints": [],
11+
"versionDefines": [
12+
{
13+
"name": "com.unity.assetbundlebrowser",
14+
"expression": "1.7.0",
15+
"define": "ASSETBUNDLEBROWSER_1_7_OR_NEWER"
16+
},
17+
{
18+
"name": "com.unity.addressables",
19+
"expression": "1.6.0",
20+
"define": "ADDRESSABLES_1_6_OR_NEWER"
21+
}
22+
],
23+
"noEngineReferences": false
24+
}

package.json

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
{
22
"name": "com.unity.assetgraph",
33
"displayName": "Asset Graph",
4-
"version": "1.7.0-preview",
4+
"version": "1.7.1-preview",
55
"unity": "2018.4",
66
"description": "AssetGraph is a visual toolset lets you configure asset workflow visually in Unity. It is intended to create rule-based configuration using graphs to create and manage efficient workflow around assets.",
77
"keywords": ["asset", "bundle", "bundles", "assetbundles", "graph", "automation", "import", "resources"],
8-
"category": "Asset Bundles",
9-
"dependencies": {
10-
"com.unity.assetbundlebrowser" : "1.7.0",
11-
"com.unity.addressables" : "1.7.5"
12-
}
8+
"category": "Asset Bundles"
139
}

0 commit comments

Comments
 (0)