I've got two List:
BasicModels: As Content has to be loaded at the start of the game I instanciate and load all models into this list.
ModelsOnScreen: Every time when a Model is added to the screen I take the corresponding object out of BasicModels and put it into ModelsOnScreen. At the same time I write the ID of the Model at it's location in ModelsOnScreen.
So the problem is though I change the Id at a specific place in the list, changes are applied to all models in ModelsOnScreen.
for (int i = 0; i < _game.Models.Length; i++)
{
if (assetName == _game.Models[i].name.ToString())
{
_game.modelsOnScreen.Add(_game.Models[i]);
_game.modelsOnScreen[_game.modelsOnScreen.Count - 1].ID = nameCounter;
}
}
What could be the problem? My theory is that the Models I put into ModelsOnScreen are only references, no separate instances. If that is so, how could I solve this problem?
Any advice is welcome,
greets BC++