Last active
August 28, 2015 08:31
-
-
Save whaison/b6c360aa2beca92ae88d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public List<string> HDfilePassNameList; | |
Debug.Log ("////////////////////////////////////////////////////////////////////////////"); | |
Debug.Log ("////////////////////////再帰呼び出し はじめ///////////////////////////////////"); | |
Debug.Log ("////////////////////////////////////////////////////////////////////////////"); | |
HDfilePassNameList = new List<string> (); | |
Directory_Have_Re_call(HDpath); | |
Debug.Log ("////////////////////////////////////////////////////////////////////////////"); | |
Debug.Log ("////////////////////////再帰呼び出し おわり///////////////////////////////////"); | |
Debug.Log ("////////////////////////////////////////////////////////////////////////////"); | |
public void Directory_Have_Re_call(string dir) { | |
string[] files = Directory.GetFiles(dir); | |
foreach (string f in files) { | |
string[] filepassNameExArr= f.Split("."[0]); | |
string Extention=filepassNameExArr [filepassNameExArr.Length - 1]; | |
//Debug.Log ("Extention="+Extention); | |
string[] filepassNameArr= f.Split("/"[0]); | |
string fileName=filepassNameArr [filepassNameArr.Length - 1]; | |
string tempCheckStr=fileName.Substring(0,4); | |
bool CheckOK = false; | |
if (tempCheckStr == "temp") { | |
Debug.Log ("temp発見+"+f+ " ######### temp テキストー除外します。"); | |
CheckOK = false; | |
} else { | |
CheckOK = true; | |
} | |
if (Extention == "meta") { | |
CheckOK = true; | |
} else{ | |
CheckOK = true; | |
} | |
if (Extention == "txt") { | |
CheckOK = true; | |
} else{ | |
CheckOK = false; | |
} | |
if (CheckOK == true) { | |
//TextAssetList.Add (t); | |
Debug.Log("Directory_Have_Re_call ファイルf="+f); | |
//fileNameList.Add (fileName); | |
HDfilePassNameList.Add (f); | |
} | |
} | |
string[] dirs = Directory.GetDirectories(dir); | |
foreach (string d in dirs) { | |
string[] dirpassNameArr= d.Split("/"[0]); | |
string dirName=dirpassNameArr [dirpassNameArr.Length - 1]; | |
string tempCheckStr=dirName.Substring(0,4); | |
Debug.Log ("ディレクトリチェック tempCheckStr="+tempCheckStr); | |
bool CheckOK = false; | |
if (tempCheckStr == "temp") { | |
//Debug.Log ("temp発見+"+fileName); | |
CheckOK = false; | |
} else { | |
CheckOK = true; | |
} | |
if (CheckOK == true) { | |
Debug.Log ("Directory_Have_Re_call ディレクトリd=" + d); | |
Directory_Have_Re_call (d); | |
} else { | |
Debug.Log ("Directory_Have_Re_call ディレクトリd=" + d+ " ######### temp フォルダー除外します。"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment