How to use WWW batch download data ?

How to use WWW batch download data ?

//These two days I tried it . Can download .
//But a second problem is “How to extract from WWW different types of data?”
//Such as how to extract from WWW 001.JPG , 001.PNG, 001.Ogg , 001.theora.ogv 002.PNG , 002.jpg …

#pragma strict

var DNS : String = "www.redsky.org.cn" ;
var worksFolder: String = "00test/works/" ;
var works : boolean = true ;
var dataFolder : String = "/00test/data" ;
var data : boolean = false ;
var url : String ;
var wwwData : String ;

private var i : int ;
private var formatNumber : int ;
private var tempUrl : String ;
private var www : WWW ;


if ( works == true ){
    formatNumber = 5 ;
    tempUrl = "http://" + DNS + "/" + worksFolder  ;    
    Debug.Log("作品数量是 : " + transform.childCount );
    Debug.Log( "域名路径是 : " + tempUrl ) ;   
    
   for ( i = 1 ; i <= formatNumber ; i++ ){
        var format : String ;    
    
        format = WorksFormat( i ) ;          
        Debug.Log( "数据格式是 : " + format ) ;
    
        for ( var x : int = 0 ; x <=  transform.childCount-1  ; x++  ){            
            var child : Transform;  
            var childName : String ;
            
            Debug.Log( "模型ID : " + x) ;
            child = gameObject.transform.GetChild(x) ;
            childName = child.name ;
            Debug.Log("模型的名字是 : " + childName ) ;  //childs 不是 Transform类吗?Transform类不是没有.name变量嘛? 
            
            url = tempUrl + childName + format ;
            Debug.Log( "作品数据的完整网络路径名是 : " + url ) ;   
            
            www = new WWW ( url ) ; 
            yield www ;
            if ( www.isDone ){
                if ( www.error != null ){
                    Debug.Log( " ****************** " + childName + format + " 不存在 ************************* " );
                    wwwData = " ****************** " + childName + format + " 不存在 ************************* " ;
                }
                if ( www.error == null ){                
                    Debug.Log(  " ****************** " + childName + format + "下载完毕************************* " ) ;
//                    wwwData = www . assetBundle . mainAsset as MovieTexture;
                    wwwData = www .text ;
                    Debug.Log ( wwwData ) ;                    
                }
            }
        }
    }
}

if ( data == true ){
    formatNumber = 7 ;
    DataFormat( i ) ;
    tempUrl = "http://" + DNS + "/" + dataFolder  ;
// To be continued
    }
    
function OnGUI ( ) {
//wwwData.Play ( ) ;
GUILayout.Label ( wwwData ) ;
}

//renderer . material . mainTexture = wwwData ;

function WorksFormat( i ){
    if ( i ==1 ){
    return ".png"  ;  }
    if ( i ==2 ){
    return ".txt"  ;    }
    if ( i ==3 ){
    return ".jpg"  ;   }
    if ( i ==4 ){
    return ".ogg"  ; }
    if ( i ==5 ){
    return ".theora.ogv"  ; }    
    return ;
}


function DataFormat( i : int ){
    if ( i ==1 ){
    return ".txt"  ;     }
    if ( i ==2 ){
    return ".ogg" ;   }
    if ( i ==3 ){
    return ".png"  ;  }    
    if ( i ==4 ){
    return ".jpg"  ;   }
    if ( i ==5 ){
    return ".unitypackage" ;  }
    if ( i ==6 ){
    return ".unity" ;  }    
    if ( i ==7 ){
    return ".theora.ogv"  ;     }    
    return ;
}

// To be continued