Skip to main content

in order to load 3D-meshes to my project i created a BasicModel class. I made it a DrawableGameComponent so I can override methods like Draw & LoadContent. Plus I have access to the GraphicsDevice etc.

Now I realisedrealized that if I try to add several instances of the same GameComponent I get aan exception, that says that it is not allowed to do this.

  1. Was it even a good thing to do, making the Class a GameComponent?

  2. Is there a way to somehow differ single Components, so that I can add several copies of it to the game?

Thanks in advance,

BC++.

in order to load 3D-meshes to my project i created a BasicModel class. I made it a DrawableGameComponent so I can override methods like Draw & LoadContent. Plus I have access to the GraphicsDevice etc.

Now I realised that if I try to add several instances of the same GameComponent I get a exception, that says that it is not allowed to do this.

  1. Was it even a good thing to do, making the Class a GameComponent?

  2. Is there a way to somehow differ single Components, so that I can add several copies of it to the game?

Thanks in advance,

BC++

in order to load 3D-meshes to my project i created a BasicModel class. I made it a DrawableGameComponent so I can override methods like Draw & LoadContent. Plus I have access to the GraphicsDevice etc.

Now I realized that if I try to add several instances of the same GameComponent I get an exception that says that it is not allowed to do this.

  1. Was it even a good thing to do, making the Class a GameComponent?

  2. Is there a way to somehow differ single Components, so that I can add several copies of it to the game?

Thanks in advance.

Tweeted twitter.com/#!/StackGameDev/status/164762214652325888
Source Link

How to add several GameComponents of the same type?

in order to load 3D-meshes to my project i created a BasicModel class. I made it a DrawableGameComponent so I can override methods like Draw & LoadContent. Plus I have access to the GraphicsDevice etc.

Now I realised that if I try to add several instances of the same GameComponent I get a exception, that says that it is not allowed to do this.

  1. Was it even a good thing to do, making the Class a GameComponent?

  2. Is there a way to somehow differ single Components, so that I can add several copies of it to the game?

Thanks in advance,

BC++