private void Update() { if (!active) { return; } if (Input.GetKeyDown(KeyCode.Return)) { output.addText(inputField.text, true); checkInput.CheckInput(inputField.text); resetInput(); scroll.updateScroll(); } if (Input.GetKeyDown(KeyCode.UpArrow)) { selectCommand(-1); } if (Input.GetKeyDown(KeyCode.DownArrow)) { selectCommand(1); } if (Input.GetKeyDown(KeyCode.Tab)) { setWord(); } }
public void create(GameObject parent, User server) { this.windowHeight = (Camera.main.orthographicSize * 2) * this.pixelsPerUnit; this.windowWidth = this.windowHeight * (float)16 / 9; this.parent = parent; var amountOfWalls = Mathf.Ceil(this.windowWidth / this.fireWidth); for (int i = 0; i < amountOfWalls; i++) { var fireWall = Instantiate(wallPiece) as GameObject; fireWall.transform.SetParent(this.parent.transform); //calculation: (windowWidth/2)/-pixelsPerUnit var xPos = -8.3889f + (i * (this.fireWidth / this.pixelsPerUnit)); fireWall.transform.localPosition = new Vector3(xPos, 8, 1); wallTiles.Add(fireWall); } StartCoroutine(waitForEnd(server)); output.addText("Successfully initialized attack.exe", false); return; }
public void CheckInput(string input) { usedCommands.Add(input); string[] arguments = input.Split(new string[] { " " }, System.StringSplitOptions.None); foreach (var command in commands.commands.Keys) { if (arguments [0] == command.ToString()) { commands.RunCommand(command, arguments); return; } } output.addText(arguments[0] + ": command not found", false); }