1
1
using UnityEditor ;
2
+ using UnityEngine ;
2
3
using UnityEditor . IMGUI . Controls ;
3
4
using System . Collections . Generic ;
4
5
using System . IO ;
5
6
using System . Runtime . Serialization . Formatters . Binary ;
6
7
using System . Linq ;
7
8
8
- namespace UnityEngine . AssetBundles
9
+ namespace AssetBundleBrowser
9
10
{
10
11
[ System . Serializable ]
11
- public class AssetBundleInspectTab
12
+ internal class AssetBundleInspectTab
12
13
{
13
14
Rect m_Position ;
14
15
[ SerializeField ]
@@ -23,7 +24,7 @@ public class AssetBundleInspectTab
23
24
[ SerializeField ]
24
25
private TreeViewState m_BundleTreeState ;
25
26
26
- public Editor m_Editor = null ;
27
+ internal Editor m_Editor = null ;
27
28
28
29
private SingleBundleInspector m_SingleInspector ;
29
30
@@ -52,14 +53,14 @@ private AssetBundleRecord GetLoadedBundleRecordByName(string bundleName)
52
53
return m_loadedAssetBundles [ bundleName ] ;
53
54
}
54
55
55
- public AssetBundleInspectTab ( )
56
+ internal AssetBundleInspectTab ( )
56
57
{
57
58
m_BundleList = new Dictionary < string , List < string > > ( ) ;
58
59
m_SingleInspector = new SingleBundleInspector ( ) ;
59
60
m_loadedAssetBundles = new Dictionary < string , AssetBundleRecord > ( ) ;
60
61
}
61
62
62
- public void OnEnable ( Rect pos , EditorWindow parent )
63
+ internal void OnEnable ( Rect pos , EditorWindow parent )
63
64
{
64
65
m_Position = pos ;
65
66
if ( m_Data == null )
@@ -92,7 +93,7 @@ public void OnEnable(Rect pos, EditorWindow parent)
92
93
RefreshBundles ( ) ;
93
94
}
94
95
95
- public void OnDisable ( )
96
+ internal void OnDisable ( )
96
97
{
97
98
ClearData ( ) ;
98
99
@@ -107,7 +108,7 @@ public void OnDisable()
107
108
file . Close ( ) ;
108
109
}
109
110
110
- public void OnGUI ( Rect pos )
111
+ internal void OnGUI ( Rect pos )
111
112
{
112
113
m_Position = pos ;
113
114
@@ -152,12 +153,12 @@ private void OnGUIEditor()
152
153
}
153
154
}
154
155
155
- public void RemoveBundlePath ( string pathToRemove )
156
+ internal void RemoveBundlePath ( string pathToRemove )
156
157
{
157
158
UnloadBundle ( pathToRemove ) ;
158
159
m_Data . RemovePath ( pathToRemove ) ;
159
160
}
160
- public void RemoveBundleFolder ( string pathToRemove )
161
+ internal void RemoveBundleFolder ( string pathToRemove )
161
162
{
162
163
List < string > paths = null ;
163
164
if ( m_BundleList . TryGetValue ( pathToRemove , out paths ) )
@@ -203,7 +204,7 @@ private void BrowseForFolder(string folderPath = null)
203
204
}
204
205
}
205
206
206
- public void AddBundleFolder ( string folderPath )
207
+ internal void AddBundleFolder ( string folderPath )
207
208
{
208
209
m_Data . AddFolder ( folderPath ) ;
209
210
}
@@ -224,7 +225,7 @@ private void ClearData()
224
225
}
225
226
}
226
227
227
- public void RefreshBundles ( )
228
+ internal void RefreshBundles ( )
228
229
{
229
230
ClearData ( ) ;
230
231
@@ -310,11 +311,11 @@ private void AddFilePathToList(string rootPath, string path)
310
311
}
311
312
}
312
313
313
- public Dictionary < string , List < string > > BundleList
314
+ internal Dictionary < string , List < string > > BundleList
314
315
{ get { return m_BundleList ; } }
315
316
316
317
317
- public void SetBundleItem ( IList < InspectTreeItem > selected )
318
+ internal void SetBundleItem ( IList < InspectTreeItem > selected )
318
319
{
319
320
//m_SelectedBundleTreeItems = selected;
320
321
if ( selected == null || selected . Count == 0 || selected [ 0 ] == null )
@@ -342,17 +343,17 @@ public void SetBundleItem(IList<InspectTreeItem> selected)
342
343
}
343
344
344
345
[ System . Serializable ]
345
- public class InspectTabData
346
+ internal class InspectTabData
346
347
{
347
348
[ SerializeField ]
348
349
private List < string > m_BundlePaths = new List < string > ( ) ;
349
350
[ SerializeField ]
350
351
private List < BundleFolderData > m_BundleFolders = new List < BundleFolderData > ( ) ;
351
352
352
- public IList < string > BundlePaths { get { return m_BundlePaths . AsReadOnly ( ) ; } }
353
- public IList < BundleFolderData > BundleFolders { get { return m_BundleFolders . AsReadOnly ( ) ; } }
353
+ internal IList < string > BundlePaths { get { return m_BundlePaths . AsReadOnly ( ) ; } }
354
+ internal IList < BundleFolderData > BundleFolders { get { return m_BundleFolders . AsReadOnly ( ) ; } }
354
355
355
- public void AddPath ( string newPath )
356
+ internal void AddPath ( string newPath )
356
357
{
357
358
if ( ! m_BundlePaths . Contains ( newPath ) )
358
359
{
@@ -368,29 +369,29 @@ public void AddPath(string newPath)
368
369
}
369
370
}
370
371
371
- public void AddFolder ( string newPath )
372
+ internal void AddFolder ( string newPath )
372
373
{
373
374
if ( ! BundleFolderContains ( newPath ) )
374
375
m_BundleFolders . Add ( new BundleFolderData ( newPath ) ) ;
375
376
}
376
377
377
- public void RemovePath ( string pathToRemove )
378
+ internal void RemovePath ( string pathToRemove )
378
379
{
379
380
m_BundlePaths . Remove ( pathToRemove ) ;
380
381
}
381
382
382
- public void RemoveFolder ( string pathToRemove )
383
+ internal void RemoveFolder ( string pathToRemove )
383
384
{
384
385
m_BundleFolders . Remove ( BundleFolders . FirstOrDefault ( bfd => bfd . Path == pathToRemove ) ) ;
385
386
}
386
387
387
- public bool FolderIgnoresFile ( string folderPath , string filePath )
388
+ internal bool FolderIgnoresFile ( string folderPath , string filePath )
388
389
{
389
390
var bundleFolderData = BundleFolders . FirstOrDefault ( bfd => bfd . Path == folderPath ) ;
390
391
return bundleFolderData != null && bundleFolderData . IgnoredFiles . Contains ( filePath ) ;
391
392
}
392
393
393
- public BundleFolderData FolderDataContainingFilePath ( string filePath )
394
+ internal BundleFolderData FolderDataContainingFilePath ( string filePath )
394
395
{
395
396
foreach ( var bundleFolderData in BundleFolders )
396
397
{
@@ -415,13 +416,13 @@ private bool BundleFolderContains(string folderPath)
415
416
}
416
417
417
418
[ System . Serializable ]
418
- public class BundleFolderData
419
+ internal class BundleFolderData
419
420
{
420
- public string Path ;
421
+ internal string Path ;
421
422
422
- public IList < string > IgnoredFiles ;
423
+ internal IList < string > IgnoredFiles ;
423
424
424
- public BundleFolderData ( string path )
425
+ internal BundleFolderData ( string path )
425
426
{
426
427
Path = path ;
427
428
IgnoredFiles = new List < string > ( ) ;
0 commit comments