x


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!

more ▼

asked May 23 '12 at 03:03 PM

Fattie gravatar image

Fattie
20.1k 60 92 153

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

http://msdn.microsoft.com/en-us/library/system.type%28v=vs.71%29

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.

more ▼

answered May 23 '12 at 03:26 PM

shadowriffe gravatar image

shadowriffe
140 1 1 3

magnificent, great link. thanks for answering so quickly

May 23 '12 at 03:55 PM Fattie
(comments are locked)
10|3000 characters needed characters left

The Type class is part of .NET / Mono as well as System.ValueType ;)

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.

more ▼

answered May 23 '12 at 03:36 PM

Bunny83 gravatar image

Bunny83
46.8k 12 50 210

magnificent, thanks. every programmer loves abusing reflection so that's great.

I gave Shadow the tick since you have 21,665 points more than he ;-)

May 23 '12 at 03:56 PM Fattie
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3570
x303
x7

asked: May 23 '12 at 03:03 PM

Seen: 1554 times

Last Updated: May 23 '12 at 03:56 PM