Page 1 of 1

LoadScene() error

Posted: Fri Jul 10, 2015 10:38 am
by ilanbps
Hi,

I'v setup your project like your example and work fine :-)

Now I try to load scene by code but this not work, just SceneStreamer.SetCurrentScene("wld1lvl1sub1"); work's but it's not possible to used : SceneStreamer.IsSceneLoaded("wld1lvl1sub1");

Can you provide a simple example code to use this ?


Thanks

Re: LoadScene() error

Posted: Fri Jul 10, 2015 11:24 am
by Tony Li
Hi,

Use SceneStreamer.LoadScene():

Code: Select all

SceneStreamer.LoadScene("wld1lvl1sub1");
The line above will load "wld1lvl1sub1" as the current scene. It will also load the correct number of neighbors (set this with SceneStreamer.maxNeighborDistance) and unload any neighbor scenes that are beyond maxNeighborDistance.

Re: LoadScene() error

Posted: Mon Jul 13, 2015 2:59 am
by ilanbps
Hi Toni,

thanks for reply, i tried your code but :

error CS0120: An object reference is required to access non-static member `PixelCrushers.SceneStreamer.SceneStreamer.LoadCurrentScene(string)'

LoadCurrentScene not exist in SceneStreamer.cs

Thanks

Re: LoadScene() error

Posted: Mon Jul 13, 2015 8:37 am
by Tony Li
[EDIT: Sorry, I was going from memory. It's not

Code: Select all

FindObjectOfType<SceneStreamer>().LoadCurrentScene("wld1lvl1sub1"); //incorrect  
it's

Code: Select all

SceneStreamer.LoadScene("wld1lvl1sub1"); //correct