@@ -150,14 +150,19 @@ private static FileBrowser Instance
150
150
#pragma warning disable 0649
151
151
[ Header ( "Settings" ) ]
152
152
153
- public Color normalFileColor = Color . white ;
154
- public Color hoveredFileColor = new Color32 ( 225 , 225 , 255 , 255 ) ;
155
- public Color selectedFileColor = new Color32 ( 0 , 175 , 255 , 255 ) ;
156
-
157
- public Color wrongFilenameColor = new Color32 ( 255 , 100 , 100 , 255 ) ;
153
+ [ SerializeField ]
154
+ internal Color normalFileColor = Color . white ;
155
+ [ SerializeField ]
156
+ internal Color hoveredFileColor = new Color32 ( 225 , 225 , 255 , 255 ) ;
157
+ [ SerializeField ]
158
+ internal Color selectedFileColor = new Color32 ( 0 , 175 , 255 , 255 ) ;
159
+ [ SerializeField ]
160
+ internal Color wrongFilenameColor = new Color32 ( 255 , 100 , 100 , 255 ) ;
158
161
159
- public int minWidth = 380 ;
160
- public int minHeight = 300 ;
162
+ [ SerializeField ]
163
+ internal int minWidth = 380 ;
164
+ [ SerializeField ]
165
+ internal int minHeight = 300 ;
161
166
162
167
[ SerializeField ]
163
168
private float narrowScreenWidth = 380f ;
@@ -196,8 +201,10 @@ private static FileBrowser Instance
196
201
197
202
private Dictionary < string , Sprite > filetypeToIcon ;
198
203
199
- public Sprite multiSelectionToggleOffIcon ;
200
- public Sprite multiSelectionToggleOnIcon ;
204
+ [ SerializeField ]
205
+ internal Sprite multiSelectionToggleOffIcon ;
206
+ [ SerializeField ]
207
+ internal Sprite multiSelectionToggleOnIcon ;
201
208
202
209
[ Header ( "Internal References" ) ]
203
210
@@ -226,6 +233,7 @@ private static FileBrowser Instance
226
233
[ SerializeField ]
227
234
private FileBrowserItem itemPrefab ;
228
235
private readonly List < FileBrowserItem > allItems = new List < FileBrowserItem > ( 16 ) ;
236
+ private float itemHeight ;
229
237
230
238
[ SerializeField ]
231
239
private FileBrowserQuickLink quickLinkPrefab ;
@@ -500,7 +508,7 @@ private void Awake()
500
508
middleViewOriginalSize = middleView . sizeDelta ;
501
509
middleViewQuickLinksOriginalSize = middleViewQuickLinks . sizeDelta ;
502
510
503
- ItemHeight = ( ( RectTransform ) itemPrefab . transform ) . sizeDelta . y ;
511
+ itemHeight = ( ( RectTransform ) itemPrefab . transform ) . sizeDelta . y ;
504
512
nullPointerEventData = new PointerEventData ( null ) ;
505
513
506
514
#if ! UNITY_EDITOR && ( UNITY_ANDROID || UNITY_IOS || UNITY_WSA || UNITY_WSA_10_0 )
@@ -590,12 +598,12 @@ private void OnApplicationFocus( bool focus )
590
598
#endregion
591
599
592
600
#region Interface Methods
593
- public OnItemClickedHandler OnItemClicked { get { return null ; } set { } }
601
+ OnItemClickedHandler IListViewAdapter . OnItemClicked { get { return null ; } set { } }
594
602
595
- public int Count { get { return validFileEntries . Count ; } }
596
- public float ItemHeight { get ; private set ; }
603
+ int IListViewAdapter . Count { get { return validFileEntries . Count ; } }
604
+ float IListViewAdapter . ItemHeight { get { return itemHeight ; } }
597
605
598
- public ListItem CreateItem ( )
606
+ ListItem IListViewAdapter . CreateItem ( )
599
607
{
600
608
FileBrowserItem item = ( FileBrowserItem ) Instantiate ( itemPrefab , filesContainer , false ) ;
601
609
item . SetFileBrowser ( this ) ;
@@ -604,7 +612,7 @@ public ListItem CreateItem()
604
612
return item ;
605
613
}
606
614
607
- public void SetItemContent ( ListItem item )
615
+ void IListViewAdapter . SetItemContent ( ListItem item )
608
616
{
609
617
FileBrowserItem file = ( FileBrowserItem ) item ;
610
618
FileSystemEntry fileInfo = validFileEntries [ item . Position ] ;
@@ -1382,14 +1390,14 @@ private bool AddQuickLink( Sprite icon, string name, string path, ref Vector2 an
1382
1390
quickLink . SetQuickLink ( folderIcon , name , path ) ;
1383
1391
1384
1392
quickLink . TransformComponent . anchoredPosition = anchoredPos ;
1385
- anchoredPos . y -= ItemHeight ;
1393
+ anchoredPos . y -= itemHeight ;
1386
1394
1387
1395
addedQuickLinksSet . Add ( path ) ;
1388
1396
1389
1397
return true ;
1390
1398
}
1391
1399
1392
- public void EnsureWindowIsWithinBounds ( )
1400
+ internal void EnsureWindowIsWithinBounds ( )
1393
1401
{
1394
1402
Vector2 canvasSize = rectTransform . sizeDelta ;
1395
1403
Vector2 windowSize = windowTR . sizeDelta ;
@@ -1424,7 +1432,7 @@ public void EnsureWindowIsWithinBounds()
1424
1432
windowTR . sizeDelta = windowSize ;
1425
1433
}
1426
1434
1427
- public void OnWindowDimensionsChanged ( Vector2 size )
1435
+ internal void OnWindowDimensionsChanged ( Vector2 size )
1428
1436
{
1429
1437
float windowWidth = size . x ;
1430
1438
float quickLinksWidth = Mathf . Min ( middleViewQuickLinksOriginalSize . x , windowWidth * quickLinksMaxWidthPercentage ) ;
0 commit comments