@@ -96,7 +96,6 @@ public class MayaIntegration : DCCIntegration
96
96
private string MODULE_FILENAME { get { return "UnityFbxForMaya" ; } }
97
97
98
98
private const string PACKAGE_NAME = "com.unity.formats.fbx" ;
99
- private const string VERSION_FILENAME = "README.txt" ;
100
99
private const string VERSION_FIELD = "VERSION" ;
101
100
private const string VERSION_TAG = "{Version}" ;
102
101
private const string PROJECT_TAG = "{UnityProject}" ;
@@ -155,7 +154,6 @@ protected string MAYA_CONFIG_COMMAND { get {
155
154
private string MAYA_CLOSE_COMMAND { get {
156
155
return string . Format ( "scriptJob -idleEvent quit;" ) ;
157
156
} }
158
- private static Char [ ] FIELD_SEPARATORS = new Char [ ] { ':' } ;
159
157
160
158
protected static string GetUserFolder ( )
161
159
{
@@ -221,38 +219,7 @@ private static string GetUserStartupScriptPath(){
221
219
222
220
public static string GetPackageVersion ( )
223
221
{
224
- string result = null ;
225
-
226
- try {
227
- string FileName = System . IO . Path . Combine ( GetPackagePath ( ) , VERSION_FILENAME ) ;
228
-
229
- System . IO . StreamReader sr = new System . IO . StreamReader ( FileName ) ;
230
-
231
- // Read the first line of text
232
- string line = sr . ReadLine ( ) ;
233
-
234
- // Continue to read until you reach end of file
235
- while ( line != null )
236
- {
237
- if ( line . StartsWith ( VERSION_FIELD , StringComparison . CurrentCulture ) )
238
- {
239
- string [ ] fields = line . Split ( FIELD_SEPARATORS ) ;
240
-
241
- if ( fields . Length > 1 )
242
- {
243
- result = fields [ 1 ] ;
244
- }
245
- break ;
246
- }
247
- line = sr . ReadLine ( ) ;
248
- }
249
- }
250
- catch ( Exception e )
251
- {
252
- Debug . LogError ( string . Format ( "Exception failed to read file containing package version ({0})" , e . Message ) ) ;
253
- }
254
-
255
- return result ;
222
+ return ModelExporter . GetVersionFromReadme ( ) ;
256
223
}
257
224
258
225
private static List < string > ParseTemplateFile ( string FileName , Dictionary < string , string > Tokens )
0 commit comments