Skip to content

Commit

Permalink
added force reimporter that gets called on save
Browse files Browse the repository at this point in the history
  • Loading branch information
prime31 committed Jun 30, 2012
1 parent 539d4a0 commit d087e5d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Editor/GlobalDefinesWizard.cs
Expand Up @@ -129,6 +129,7 @@ private void save()
writeFiles( builder.ToString() );

AssetDatabase.Refresh();
reimportSomethingToForceRecompile();
}
else
{
Expand All @@ -138,6 +139,19 @@ private void save()
}


private void reimportSomethingToForceRecompile()
{
var dataPathDir = new DirectoryInfo( Application.dataPath );
var dataPathUri = new System.Uri( Application.dataPath );
foreach( var file in dataPathDir.GetFiles( "GlobalDefinesWizard.cs", SearchOption.AllDirectories ) )
{
var relativeUri = dataPathUri.MakeRelativeUri( new System.Uri( file.FullName ) );
var relativePath = System.Uri.UnescapeDataString( relativeUri.ToString() );
AssetDatabase.ImportAsset( relativePath, ImportAssetOptions.ForceUpdate );
}
}


private void deleteFiles()
{
var smcsFile = Path.Combine( Application.dataPath, "smcs.rsp" );
Expand Down

0 comments on commit d087e5d

Please sign in to comment.