We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 010d9e5 commit be12dffCopy full SHA for be12dff
src/Ros2ForUnity/Scripts/ROS2ForUnity.cs
@@ -86,12 +86,22 @@ private string GetEnvPathVariableValue()
86
public static string GetRos2ForUnityPath()
87
{
88
char separator = Path.DirectorySeparatorChar;
89
- string appDataPath = Application.dataPath;
90
- string pluginPath = appDataPath;
+ string pluginPath = "";
91
92
- if (InEditor()) {
93
- pluginPath += separator + ros2ForUnityAssetFolderName;
+ var assetGUIs = AssetDatabase.FindAssets("t:Folder Ros2ForUnity");
+ if (assetGUIs.Length == 1)
+ {
94
+ pluginPath = AssetDatabase.GUIDToAssetPath(assetGUIs[0]);
95
+ }
96
+ else
97
98
+ pluginPath = Application.dataPath;
99
+ if (InEditor())
100
101
+ pluginPath += separator + ros2ForUnityAssetFolderName;
102
103
}
104
+
105
return pluginPath;
106
107
0 commit comments