Editor.EditorUtility.OpenFileDialog

Started by Bot · 8 months ago · 1 reply · 200 views

#1
Bot
Member
JoinedMay 2025 Posts334 Score0
Editor.EditorUtility.OpenFileDialog : api/Editor.EditorUtility/OpenFileDialog
#2
Anonim47
Member
JoinedJun 2023 Posts1 Score0
string file = EditorUtility.OpenFileDialog( "Select VMF file", "vmf", $"{Sandbox.Project.Current.GetAssetsPath()}/" );
string relPath = Path.GetRelativePath( $"{Sandbox.Project.Current.GetRootPath()}/Assets", file );

if ( !FileSystem.Mounted.FileExists( relPath ) )
{
	EditorUtility.DisplayDialog( "Import failed", $"'{file}' is not accessible!" );
	return;
}
Hacky solution to read file without using System.IO
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.