How to return a class type as a variable. Same as how "if (player.gameObject)" returns a bool.

Typing “if (player.gameObject)” is the same as typing “if (player.gameObject != null)”. How does Unity return a bool for a GameObject?

I have a class, Node, that has a few variables including “position”. Is there a way I can have it so you can type “return node_” instead of “return node*.position” to return its position easier?*_

The text of your question bears no obvious relation to the title. What are you really asking?

If you are asking about an implicit value conversion, yes, you can write such a function like this.

  public static implicit operator Position(Node n) {
        return n.Position;
  }

Unity can return a bool for if (player.gameObject) because of how the boolean operators are overriden on the GameObject class.

From Unity - Scripting API: GameObject :