Send variable to EV3 via WiFi
First, you need to learn how to make a TCP connection to your EV3. There is a good guide on this here.

Then you need to learn about EV3 VM bytecodes and how to send direct commands.

Since you are using Unity, you may be able to use a pre-existing library such as the MonoBrick Communication Library or the Brian Peek library.

To send a variable, you need to use mailbox commands along with "Messaging" blocks in the EV3-G software.