How can I find the variables attached to a game object?

Hellos, Im trying figure this out, the idea is to get all the variables from a gameobject (perhaps a list) and aquire its Name,Type,Value according to the Variables output.

I know you can do Variables.Object(gameObject).Get(“variableName”); , but I would love to see if I can universally get them and do what I need with them.

Can someone shed some light into the going about this?

Thanks.

For reference I was able to guess with some tinkinering

Was having a hard time with finding the type but this base works to start.

        var vars = Variables.Object(gameObject);
        foreach (var var in vars) {
            var varName = var.name;// "Name" of variable from inspector
            if (var.value is String) {
                //value is a string type
            }

            if (var.value is int) {
                //value is an int
            }

            if (var.value is ClassName) {
                //value is a class type of ClassName
            }
        }