Is it possible to get an array of all variables in a component?

So, I am making an in-game console, but to do so, I need a way to get all the variables available in a component, or atleast to get a variable via TextField and therefore modify it. Is it possible?

Thanks in advance!

through reflection you can use sometype.GetType().GetProperties(), this will return an array of PropertyInfo, you can iterate through and get the name of each property. If this is a custom type, that would be ideal, you will get a lot of love from classes/types that inherit/derive from MonoBehavior.