![]() ![]() ![]() Note that I’m writing the x, y and z coordinates separately. TimeUntilNextPositionWrite += TIME_BETWEEN_POSITION_WRITES TimeUntilNextPositionWrite -= ltaTime įileWriter.WriteLine("" + ) įileWriter.WriteLine("" + ) įileWriter.WriteLine("" + ) String fileName = Application.persistentDataPath + "/" + FILE_NAME before you want to start writing (the code working for Unit圓.3 for older versions see above) Krodil, something like this should do the trick:Ĭonst float TIME_BETWEEN_POSITION_WRITES = 0.5f Thanks, erique, for pointing this out on the Unity forum. This code would replace the code above: string fileName = Application.persistentDataPath + "/" + FILE_NAME Use Application.persistentDataPath to do the trick. ![]() Since Unity 3.3, it is no longer necessary to use platform-specific code for simple file I/O. String fileNameBase = (0, ('/')) įileName = fileNameBase.Substring(0, fileNameBase.LastIndexOf('/')) + "/Documents/" + FILE_NAME įileName = Application.persistentDataPath + "/" + FILE_NAME įileName = Application.dataPath + "/" + FILE_NAME This code will do the trick and works on PC, Mac, iOS and Android: string fileName = "" ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |