BitmapSaverWindow.SaveAssets C# (CSharp) Method

SaveAssets() public method

public SaveAssets ( ) : void
return void
    public void SaveAssets()
    {
        if(!Directory.Exists( fPath )){

            if ( EditorUtility.DisplayDialog("The Directory doesnt exist", "Create a new Directory in \n" + fPath, "Choose", "Cancel") )
                Directory.CreateDirectory( fPath );
            else
                return;
        }

        try
        {
            float i = 1;
            float f = fLength;
            foreach( string s in fList ){

                EditorUtility.DisplayProgressBar("Convert Data " + i + " / " + f, s, i/f);

                Texture2D texture = Resources.LoadAssetAtPath( s, typeof(Texture2D) ) as Texture2D;
                string 	  nFile   = fPath + Path.GetFileNameWithoutExtension( s ) + "."+ fTypes[fType];

                TextureImporterSetup( texture );

                if( AssetDatabase.GetAssetPath( texture ) != null ) {
                    BinaryData.Save( texture, nFile );
                    if( saveSource && IsTargetFolder( s )) File.Delete( s );
                }
                i++;
            }
        }
        finally
        {
            AssetDatabase.Refresh();
            EditorUtility.ClearProgressBar();

            selectedIndex = -1;
            fList = null;
            fLength = 0;
        }
    }