I have a small problem with materials, in my game.
I have a class "computer" with its entity and its behaviour.
In the room, I have 8 computers.
In the 3D object, I have a material called "computer/screen".
And I want to change this material, for only one computer, for writting a red large "ALARM" (for instance).
I was using the following code, to find the material:
Code: Select all
int NumSubEntities = mEntity->getNumSubEntities();
for (int i=0; i<NumSubEntities; i++)
{
String MatName = mEntity->getSubEntity(i)->getMaterialName();
if (MatName == "computer/screen") mScreenEntity=i;
}
Code: Select all
mEntity->getSubEntity(mScreenEntity)->setMaterialName("computer/alarm");
Do you know if there is a way to change a material, for only one instance of several entities ?
thanks