@@ -222,6 +222,9 @@ public static bool CheckWriteAccessToDestinationDirectory
222222 set { m_checkWriteAccessToDestinationDirectory = value ; }
223223 }
224224
225+ public static bool CanDeleteFiles = true ;
226+ public static bool CanRenameFiles = true ;
227+
225228#if UNITY_EDITOR || ( ! UNITY_ANDROID && ! UNITY_IOS && ! UNITY_WSA && ! UNITY_WSA_10_0 )
226229 private static float m_drivesRefreshInterval = 5f ;
227230#else
@@ -379,12 +382,6 @@ public static FileBrowser Instance
379382 [ SerializeField ]
380383 private bool generateQuickLinksForDrives = true ;
381384
382- [ SerializeField ]
383- private bool contextMenuShowDeleteButton = true ;
384-
385- [ SerializeField ]
386- private bool contextMenuShowRenameButton = true ;
387-
388385 [ SerializeField ]
389386 private bool showResizeCursor = true ;
390387
@@ -1363,8 +1360,8 @@ private void ShowContextMenuAt( Vector2 position, bool isMoreOptionsMenu )
13631360
13641361 bool selectAllButtonVisible = isMoreOptionsMenu && m_allowMultiSelection && validFileEntries . Count > 0 ;
13651362 bool deselectAllButtonVisible = isMoreOptionsMenu && selectedFileEntries . Count > 1 ;
1366- bool deleteButtonVisible = contextMenuShowDeleteButton && selectedFileEntries . Count > 0 ;
1367- bool renameButtonVisible = contextMenuShowRenameButton && selectedFileEntries . Count == 1 ;
1363+ bool deleteButtonVisible = CanDeleteFiles && selectedFileEntries . Count > 0 ;
1364+ bool renameButtonVisible = CanRenameFiles && selectedFileEntries . Count == 1 ;
13681365
13691366 if ( selectAllButtonVisible && m_pickerMode == PickMode . Files )
13701367 {
@@ -2259,7 +2256,7 @@ private IEnumerator CreateNewFolderCoroutine()
22592256 // Prompts user to rename the selected file/folder
22602257 public void RenameSelectedFile ( )
22612258 {
2262- if ( selectedFileEntries . Count != 1 )
2259+ if ( ! CanRenameFiles || selectedFileEntries . Count != 1 )
22632260 return ;
22642261
22652262 MultiSelectionToggleSelectionMode = false ;
@@ -2320,7 +2317,7 @@ public void RenameSelectedFile()
23202317 // Prompts user to delete the selected files & folders
23212318 public void DeleteSelectedFiles ( )
23222319 {
2323- if ( selectedFileEntries . Count == 0 )
2320+ if ( ! CanDeleteFiles || selectedFileEntries . Count == 0 )
23242321 return ;
23252322
23262323 selectedFileEntries . Sort ( ) ;
0 commit comments