Masstronaut / Engine

gonna make it good
3 stars 1 forks source link

Modify/Update the CModel component of an Entity #33

Closed aaldwell closed 6 years ago

aaldwell commented 6 years ago

Currently the only way to do is with a: Remove; Add("newmodel.obj"); //Remove fix pending

Suggested solution: EntityRef::Update()("newmodel.obj")

Ensure that the current model is only deleted from memory when there are 0 references to it. I.E. Create a few clones, update the model on just one without breaking the others.

Masstronaut commented 6 years ago

Does this code snippet resolve your issue? EnemyA.Get<CModel>() = CModel{ "model.obj" };

aaldwell commented 6 years ago

Yes, thank you. Closing Issue. :)