@@ -300,10 +300,9 @@ private void RefreshVersionNames()
300300 m_VersionNamesForTargetDisplay = new string [ m_VersionNames . Length ] ;
301301 for ( int i = 0 ; i < m_VersionNames . Length ; i ++ )
302302 {
303- string [ ] versionSplits = m_VersionNames [ i ] . Split ( '_' ) ;
304- string versionForDisplay = Utility . Text . Format ( "{0}.{1}.{2} ({3})" , versionSplits [ 0 ] , versionSplits [ 1 ] , versionSplits [ 2 ] , versionSplits [ 3 ] ) ;
305- m_VersionNamesForSourceDisplay [ i + 1 ] = versionForDisplay ;
306- m_VersionNamesForTargetDisplay [ i ] = versionForDisplay ;
303+ string versionNameForDisplay = GetVersionNameForDisplay ( m_VersionNames [ i ] ) ;
304+ m_VersionNamesForSourceDisplay [ i + 1 ] = versionNameForDisplay ;
305+ m_VersionNamesForTargetDisplay [ i ] = versionNameForDisplay ;
307306 }
308307
309308 m_SourceVersionIndex = 0 ;
@@ -328,23 +327,48 @@ private void RefreshTargetVersionCount()
328327 }
329328 }
330329
330+ private string GetVersionNameForDisplay ( string versionName )
331+ {
332+ if ( string . IsNullOrEmpty ( versionName ) )
333+ {
334+ return "<None>" ;
335+ }
336+
337+ string [ ] splitedVersionNames = versionName . Split ( '_' ) ;
338+ return Utility . Text . Format ( "{0}.{1}.{2} ({3})" , splitedVersionNames [ 0 ] , splitedVersionNames [ 1 ] , splitedVersionNames [ 2 ] , splitedVersionNames [ 3 ] ) ;
339+ }
340+
331341 private void OnBuildResourcePacksStarted ( int count )
332342 {
343+ Debug . Log ( Utility . Text . Format ( "Build resource packs started, '{0}' items to be built." , count . ToString ( ) ) ) ;
333344 EditorUtility . DisplayProgressBar ( "Build Resource Packs" , Utility . Text . Format ( "Build resource packs, {0} items to be built." , count . ToString ( ) ) , 0f ) ;
334345 }
335346
336347 private void OnBuildResourcePacksCompleted ( int successCount , int count )
337348 {
349+ int failureCount = count - successCount ;
350+ string str = Utility . Text . Format ( "Build resource packs completed, '{0}' items, '{1}' success, '{2}' failure." , count . ToString ( ) , successCount . ToString ( ) , failureCount . ToString ( ) ) ;
351+ if ( failureCount > 0 )
352+ {
353+ Debug . LogWarning ( str ) ;
354+ }
355+ else
356+ {
357+ Debug . Log ( str ) ;
358+ }
359+
338360 EditorUtility . ClearProgressBar ( ) ;
339361 }
340362
341363 private void OnBuildResourcePackSuccess ( int index , int count , string sourceVersion , string targetVersion )
342364 {
365+ Debug . Log ( Utility . Text . Format ( "Build resource packs success, source version '{0}', target version '{1}'." , GetVersionNameForDisplay ( sourceVersion ) , GetVersionNameForDisplay ( targetVersion ) ) ) ;
343366 EditorUtility . DisplayProgressBar ( "Build Resource Packs" , Utility . Text . Format ( "Build resource packs, {0}/{1} completed." , ( index + 1 ) . ToString ( ) , count . ToString ( ) ) , ( float ) index / count ) ;
344367 }
345368
346369 private void OnBuildResourcePackFailure ( int index , int count , string sourceVersion , string targetVersion )
347370 {
371+ Debug . LogWarning ( Utility . Text . Format ( "Build resource packs failure, source version '{0}', target version '{1}'." , GetVersionNameForDisplay ( sourceVersion ) , GetVersionNameForDisplay ( targetVersion ) ) ) ;
348372 EditorUtility . DisplayProgressBar ( "Build Resource Packs" , Utility . Text . Format ( "Build resource packs, {0}/{1} completed." , ( index + 1 ) . ToString ( ) , count . ToString ( ) ) , ( float ) index / count ) ;
349373 }
350374 }
0 commit comments