/// --------------- SETUP SCREEN METHODS ---------------- private void PlayerInputBox_KeyDown(object sender, KeyEventArgs e) { // if the user presses Enter key in the PlayerInputBox, treat it like they // pressed the Add button, then focus back to the inputbox if ((e.Key == Key.Enter) && (PlayerInputBox.Text != "")) { AddButton_Click(this, new RoutedEventArgs()); PlayerInputBox.Focus(); } }
private void Awake() { gameMananger = GameMananger.instance; rb = GetComponent <Rigidbody2D>(); playerInputBox = GetComponent <PlayerInputBox>(); }