'Reverse' the UnityEvent inspector helper to return variables

Basically i’m trying to use the cool feature UnityEvents have in the inspector where you can drag objects into it and call functions or set variables in connected components but in reverse. I want to select variable and have it return the variable.

public UnityEvent var; //In the inspector you set up what variable you want to get

myText.text = var.ToString();

This is literally just made up code but I hope it gets the point across.

Check out the RemoteFloatField in Trend.Me. It does exactly this job.

https://bitbucket.org/BoredMormon/trend.me

Note that doing things this way requires some editor magic and a lot of reflection.