File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -86,12 +86,22 @@ private string GetEnvPathVariableValue()
86
86
public static string GetRos2ForUnityPath ( )
87
87
{
88
88
char separator = Path . DirectorySeparatorChar ;
89
- string appDataPath = Application . dataPath ;
90
- string pluginPath = appDataPath ;
89
+ string pluginPath = "" ;
91
90
92
- if ( InEditor ( ) ) {
93
- pluginPath += separator + ros2ForUnityAssetFolderName ;
91
+ var assetGUIs = AssetDatabase . FindAssets ( "t:Folder Ros2ForUnity" ) ;
92
+ if ( assetGUIs . Length == 1 )
93
+ {
94
+ pluginPath = AssetDatabase . GUIDToAssetPath ( assetGUIs [ 0 ] ) ;
95
+ }
96
+ else
97
+ {
98
+ pluginPath = Application . dataPath ;
99
+ if ( InEditor ( ) )
100
+ {
101
+ pluginPath += separator + ros2ForUnityAssetFolderName ;
102
+ }
94
103
}
104
+
95
105
return pluginPath ;
96
106
}
97
107
You can’t perform that action at this time.
0 commit comments