- Home /
Question by
umurcg · Dec 04, 2016 at 07:09 PM ·
singletondesign-patterns
Can a gameobject replace another gameobject including variables that referencing to that object?
Hello,
I am using singleton class for my player object. With that design if I come from another scene, player object of new scene is destroyed and object that comes from previous scene is preserved.
However before I implemented that approach, I wrote lots of scripts that referencing to player. And when my player comes from another script those references becomes null while original player is destroyed.
So are there any method for replacing these references with new player object. Or should I go to each script and make these references with referencing static object of player?
Comment