Using placenote across different scenes


Just found that it seems placenote is not working when swithing scenes.

e.g. If I start sceneA(which initialize placenote, in it’s Start() it initialize placcenote), then switch to scene B(which is just a normal scene without placenote), them switch back to scene A, you would find placenote is found ‘not initialzed’.

I though it might be due to that scripts ‘LibPlacenote.cs’ and ‘PlacenoteCameraManager.cs’ (which are attached to object ‘PNSessionOrigin’) are killed when the object is destroyed with scene A. Then I tried to do a trick that I moved those two scripts to another object, and modified the ‘Awake()’ of LibPlacenote.cs’ like below:

if (Instance == null)
sInstance = this;
else if (Instance != this)
Destroy (gameObject);

By doing this, those two scripts and the object they attached to would not be destroyed across scenes. The result is a little bit better: when switching back to A from B, Placenote state is found ‘initialized’, but actually when you try to map, or localize, it would get stuck!

(All the switching is done with ‘SceneManager.LoadScene’)

So, could you give some suggestion on how we use placenote across different scene?