void Update() { if (Input.GetKeyDown(KeyCode.Return)) { ChangeDebugMode(); } // bgcolor; var clr = Color.Lerp(this.fromColor, this.modeColor, this.colorChangeProgress); this.colorChangeProgress += Time.deltaTime * this.colorChangeSpeed; Camera.main.backgroundColor = clr; if (!this.isDebugMode) { return; } // key check inputMode foreach (var k in keyInput) { if (Input.GetKeyDown(k)) { Debug.Log("Key down " + k); this.inputTarget = keyInput.IndexOf(k); this.inputTargetString = k; break; } if (Input.GetKeyUp(k)) { Debug.Log("Key up " + k); this.inputTargetString = ""; if (this.console.text != "" && this.console.text != debugStartingString && inputTarget >= 0) { try{ var inputCount = System.Convert.ToInt32(this.console.text); this.gaugeInterface.ForceAddion(inputTarget, inputCount); this.fromColor = successColor; this.colorChangeProgress = 0f; LogIO.Log(DateTime.Now.ToString() + ",ForceInput," + k + "," + this.console.text + "\r\n"); }catch (System.Exception e) { // 桁数大杉とかでやれない場合。 LogIO.ErrorLog(e.ToString()); this.fromColor = errorColor; this.colorChangeProgress = 0f; } } this.console.text = ""; inputTarget = -1; } } CheckKeyInput(); }
private Log() { _logio = new FileLog(); _running = true; _wthread = new Thread(WritingProcess); _wthread.IsBackground = true; _wthread.Start(); _timer = new Timer(TimeLogProcess, null, 0, 1000); }
void Awake() { if (instance == null) { instance = this; } else { Debug.LogWarning("LogIO is already exist."); Destroy(this); } this.gaugeInterface = GetComponent <GaugeInterface>(); logPath = "/../../"; this.yesterday = DateTime.Today.AddDays(-1).ToString(dateTimeFormat); this.today = DateTime.Today.ToString(dateTimeFormat); this.isFileOpen = false; }
static void Main(string[] args) { LogIO.GetInstance().Start(); Console.ReadKey(); }
void Logging(int i) { var log = DateTime.Now.ToString() + ",InputKey," + this.keys[i].ToString() + "\r\n"; LogIO.Log(log); # if UNITY_EDITOR
void do_save_as(string filename) { LogIO io; StreamWriter writer; io = new LogIO (); try { writer = new StreamWriter (filename); io.Save (writer, full_log, new SystemtapSerializer ()); writer.Close (); } catch (Exception e) { Console.WriteLine ("exception while saving: {0}", e); /* FIXME */ } }
void do_open(string filename) { LogIO io; StreamReader reader; Log new_log; try { io = new LogIO (); reader = new StreamReader (filename); new_log = io.Load (reader, new SystemtapParser ()); reader.Close (); } catch (Exception e) { Console.WriteLine ("exception while loading: {0}", e); /* FIXME */ return; } set_record_mode (RecordMode.Stopped); full_log = new_log; set_derived_model (); }