diff --git a/Source/Editor/Plugins/PluginUtils.cs b/Source/Editor/Plugins/PluginUtils.cs index 389e24ff0..73e100b58 100644 --- a/Source/Editor/Plugins/PluginUtils.cs +++ b/Source/Editor/Plugins/PluginUtils.cs @@ -28,12 +28,24 @@ namespace FlaxEditor var assemblyName = assembly.GetName().Name; var dotEditorPos = assemblyName.LastIndexOf(".Editor", StringComparison.OrdinalIgnoreCase); if (dotEditorPos != -1) - assemblyName = assemblyName.Substring(dotEditorPos); - - var iconPath = Path.Combine(Path.GetDirectoryName(assemblyPath), assemblyName + ".Icon.flax"); + assemblyName = assemblyName.Substring(0, dotEditorPos); + var dotCSharpPos = assemblyName.LastIndexOf(".CSharp", StringComparison.OrdinalIgnoreCase); + if (dotCSharpPos != -1) + assemblyName = assemblyName.Substring(0, dotCSharpPos); + var assemblyDir = Path.GetDirectoryName(assemblyPath); + // Try path relative to the plugin binary + var iconPath = Path.Combine(assemblyDir, assemblyName + ".Icon.flax"); if (!File.Exists(iconPath)) - return null; + { + // Try path relative to the plugin project Content + iconPath = Path.Combine(assemblyDir, "../../../../../Content", assemblyName + ".Icon.flax"); + MessageBox.Show(StringUtils.NormalizePath(StringUtils.RemovePathRelativeParts(iconPath))); + if (!File.Exists(iconPath)) + { + return null; + } + } return FlaxEngine.Content.LoadAsync(iconPath); } diff --git a/Source/Editor/ProjectInfo.cs b/Source/Editor/ProjectInfo.cs index 07b40c69d..7534de230 100644 --- a/Source/Editor/ProjectInfo.cs +++ b/Source/Editor/ProjectInfo.cs @@ -189,7 +189,6 @@ namespace FlaxEditor // Absolute referencePath = reference.Name; } - referencePath = StringUtils.RemovePathRelativeParts(referencePath); // Load referenced project reference.Project = Load(referencePath);