Actually, what is "System.Type" ?

I’m familiar with System.ValueType, how to use it, and so on.

But what “is” System.Type?

What does it mean, what does it do? Is it part of JavaScript as such, or part of Unity, or something to do with “.Net” or ???

Can you extends System.Type, how would you do so and why, and so on?? Is there a “list of” all the System.type somewhere??

(Indeed … where would you find the documentation for, or explanation of, what that is??)

I’m afraid I know nothing about this sort of thing — thanks!

The javascript and C# in Unity all tie into .NET, so any class like that you should be able to at least get an idea of how to use via MSDN.

As it can represent a class, there is no list, as there are infinite classes.

The Type class is part of .NET / Mono as well as System.ValueType :wink:

The Type class is a meta class that is used to describe other classes / types. Every type in .NET has it’s Type descriptor. This descriptor can be retrived via the typeof operator in C#

// C#
System.Type myDescriptor = typeof(Transform);

UnityScript (JS) seems to do that automatically as you can see when using GetComponent.

The Type class is the most important part of the reflection features of .NET / Mono. With it you can use a certain type in a more generic way. You can browse through the variables of a class, execute functions by a string name…

Every type in .NET is derived from System.Object. That’s why every type (even int and float) have a ToString function and the GetType function. While the typeof operator returns the TypeObject for a given type, GetType returns the TypeObject at runtime dynamically.