void Update() { if (Input.GetKey(KeyCode.Escape)) { Application.Quit(); } if (Input.GetKeyUp(KeyCode.R)) { demoDNAInserted = true; bestRobotDNA = null; bestRobotFitness = 0; generation = 0; robotNum = 0; actualRobot.Die(); } if (Input.GetKeyDown(KeyCode.Delete)) { actualRobot.Die(); } if (Input.GetKeyDown(KeyCode.C)) { string bestDNAString = Miscellaneous.ArrayToString <float>(bestRobotDNA); #if !UNITY_EDITOR && UNITY_WEBGL Application.ExternalCall("copyBestDNA", bestDNAString); #endif TextEditor te = new TextEditor(); te.content = new GUIContent(bestDNAString); te.SelectAll(); te.Copy(); } if (Input.GetKeyDown(KeyCode.Plus) || Input.GetKeyDown(KeyCode.Equals)) { Time.timeScale = Math.Min(Time.timeScale + 5, 25); } if (Input.GetKeyDown(KeyCode.Minus)) { Time.timeScale = Math.Max(Time.timeScale - 5, 0); } }
public string GetSensorsString() { bool[] sensorsArray = new bool[sensors.Count]; sensors.Values.CopyTo(sensorsArray, 0); return(Miscellaneous.ArrayToString(sensorsArray)); }