paul.w Posted April 15, 2014 Share Posted April 15, 2014 Hi How to use getNumFiles and open : https://developer.unigine.com/en/docs/1.0/scripting/core/class.dir#getNumFiles_int Any imports? What do I have to do? Because I get errors with the following line: int numFile = getNumFiles(fpath + "all_unigine_newgame/videos"); Link to comment
ivan.cuevas Posted April 15, 2014 Share Posted April 15, 2014 Dir is a class, you have to create an instance. ///... Dir directory = new Dir(); if(directory.open(engine.getDataPath() + path)) { forloop(int i = 0; directory.getNumFiles()) { string name = basename(directory.getFileName(i)); if(strrstr(name,".world") == -1) continue; names.append(replace(name,".world","")); } directory.close(); } delete directory; /// ... Link to comment
paul.w Posted April 15, 2014 Author Share Posted April 15, 2014 thanks :) That really help :) [sOLVED] Link to comment
Recommended Posts