make a type of variable set to anything?

Im dealing with rpcs.
I want a variable to be able to set to anything such as

ANYVAR = 5;
ANYVAR = “Variable”;
ANYVAR = Thisgameobject.networkview.veiwid;

Something like that so it can be flexible. Then I will handle converting it.

You use the object type.

object something = new AClass();
AClass a_class_instance = (AClass) something;
something = new OtherClass();
OtherClass other_class_instance = (OtherClass) something;