How could I combine these two scripts

One of the scripts is for an input field that will only allow enter as input, so if input field loses focus without enter pressed such as a mouse click nothing will enter

.

Code for the input field is in in a reply to this message

.

The other script is for an enemy that once destroyed question prompt appears that has the input field that I am trying to fix


1 - This is unity answers, not code prividers inc.

2 - We will not work on a image code…

3 - If you knwo what are you doing in the codes, you will be able to merge them.

Good luck.