Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- // Paste methods into script, be sure to call InitializeLogFile in Start().
- // To add output to file, call Output(), and pass the message to output as a parameter.
- // Be sure to switch "ADD PATH HERE" with whatever path you want the log to be saved to.
- void InitializeLogFile(){
- System.IO.File.WriteAllText(@"ADD PATH HERE" + "\log.txt", DateTime.Now.ToString());
- }
- void Output(string message){
- System.IO.StreamWriter file = new System.IO.StreamWriter(@"ADD PATH HERE" + "\log.txt", true){
- file.WriteLine(message);
- }
Add Comment
Please, Sign In to add comment