Firstly, my apologies for the title of the question. I'm not quite sure what he called what I'm trying to accomplish, so I just go to him.
I am currently developing a game engine in C # using GDI + and have implemented a component class. The idea is that any game object can have several components to it (like Unity3D), and I want to find any component of any type by looking for what class it is.
In this note, I would like to modify this piece of code:
Rigidbody r = obj.GetComponentOfType(typeof(Rigidbody)) as Rigidbody;
To look like this:
Rigidbody r = obj.GetComponentOfType<Rigidbody>();
How should I do it?
Sorry if my question seems vague, any light on this topic will be wonderful!
user6943628