static public int Count() { if (listener == null) { (listener = new AssetImportListener()).SetCallback(() => currentLineCount = -1); } if (currentLineCount < 0) { int count = 0; var files = DirSearch(Application.dataPath); foreach (string path in files) { if (!path.EndsWith(".cs") && !path.EndsWith(".js")) { continue; } count += File.ReadAllText(path).Count(x => x == ';'); } currentLineCount = count; } return(currentLineCount); }
public AssetImportListener() { self = this; }