Description
The OnFileSelected
field is an event handler that is triggered when a file is selected in the AssetBrowser
. This selection can occur through a double-click or by pressing the enter key. The event handler is of type System.Action<System.String>
, meaning it takes a single string parameter, which represents the path or identifier of the selected file.
Usage
To use the OnFileSelected
event, you need to assign a method that matches the signature void MethodName(string filePath)
to it. This method will be called whenever a file is selected in the AssetBrowser
.
Example usage:
AssetBrowser assetBrowser = new AssetBrowser();
assetBrowser.OnFileSelected += (filePath) => {
// Handle the file selection
// For example, open the file or display its properties
OpenFile(filePath);
};
Example
AssetBrowser assetBrowser = new AssetBrowser();
assetBrowser.OnFileSelected += (filePath) => {
// Handle the file selection
// For example, open the file or display its properties
OpenFile(filePath);
};