Playmaker Forum

Playmaker Updates & Downloads => Share New Actions => Topic started by: dudebxl on April 22, 2016, 01:03:45 PM

Title: (unity5.3.4+) Scene Manager
Post by: dudebxl on April 22, 2016, 01:03:45 PM
Scene Manager actions for Unity 5.3.4 or newer.

Info: http://docs.unity3d.com/Manual/MultiSceneEditing.html

search for 'scene manager' in ecosystem Missing from ecosystem: get here: https://github.com/dudebxl/PlayMakerCustomActions_U5/tree/master/Assets/PlayMaker%20Custom%20Actions/Level

Actions:
ArrayListGetRootGameObjects
ArrayGetRootGameObjects
CreateScene
UnloadSceneNum
SetActiveScene
SceneIsLoadedNum
GetActiveSceneName
MergeScene
UnloadScene
SetActiveSceneNum
MergeScenePath
MergeSceneNum
SetActiveSceneByPath
MoveGameObjectToSceneNum
MoveGameObjectToScene
GetActiveSceneAt
SceneRootTransformCount
SceneIsValid
GetBuildSceneIndex
SceneCount
SceneIsLoaded
SceneTest
SceneIsDirty
GetScenePath

Not fully tested so any problems, pm here.
Title: Re: (unity5.3+) Scene Manager
Post by: KoneJone on May 21, 2016, 02:05:07 AM
Hi, and thanks for these.

I installed SceneIsValid from the Ecosystem, but while building the script, Unity throws this error: "Assets/PlayMaker Custom Actions/Level/SceneIsValid.cs(35,25): error CS0246: The type or namespace name `Scene' could not be found. Are you missing a using directive or an assembly reference?""

What to do? I'm running Unty 5.3.2f1 and Playmaker 1.8.0.f43.
Title: Re: (unity5.3+) Scene Manager
Post by: dudebxl on May 21, 2016, 10:59:56 AM
Hi,

What do you mean by build? build meaning building game or build meaning compiling the scripts in the editor (if this one, then i don't know cause i just downloaded from eco and i do not get any errors)?
Title: Re: (unity5.3+) Scene Manager
Post by: dudebxl on May 21, 2016, 12:22:01 PM
*** update bump for 'SceneIsLoaded...' - corrected a everyframe bug
Title: Re: (unity5.3+) Scene Manager
Post by: KoneJone on May 22, 2016, 07:40:42 AM
What do you mean by build? build meaning building game or build meaning compiling the scripts in the editor (if this one, then i don't know cause i just downloaded from eco and i do not get any errors)?

Ah, sorry. I meant compiling scripts in the editor, i.e. as soon as I install the action from Ecosystem, it displays that error.
Title: Re: (unity5.3+) Scene Manager
Post by: dudebxl on May 22, 2016, 07:49:20 AM
mmm i don't know. i re-downloaded from ecosystem and i have no errors (millions of warnings lol but no errors). I made the actions using Unity 5.3.4

Maybe if you can, try the action in unity 5.3.4 and see if you have any errors.

Let me know..
Title: Re: (unity5.3+) Scene Manager
Post by: KoneJone on June 02, 2016, 10:01:19 AM
That was a good idea - I updated to 5.3.4 and the error went away!

But, now I have a new one: I was intending to use Is Scene Valid to check if a scene exists in the project or not, but it doesn't seem to work like that. Even if I write the correct scene name, and check that it's in Build Settings written exactly like that, the isValid result is always "false".

To debug, I temporarily changed target = SceneManager.GetSceneByName(sceneName.Value); to target = SceneManager.GetActiveScene(); and then everything worked as expected, so I think the GetSceneByName is the culprit here.

Did you happen to test this yourself? Should it be possible to check if a scene exists, or is it intended for something else?

EDIT: By mad googling I found out that the IsValid() only applies to loaded scenes, i.e. a scene needs to be loaded to be valid.
Title: Re: (unity5.3.4+) Scene Manager
Post by: dudebxl on June 03, 2016, 01:26:25 PM
Ok cool.... So everything is good then?
Title: Re: (unity5.3.4+) Scene Manager
Post by: KoneJone on June 04, 2016, 12:45:45 AM
Yep, everything working as expected with 5.3.4. :)
Title: Re: (unity5.3.4+) Scene Manager
Post by: hypermitch on January 23, 2017, 05:19:24 AM
I can't find "scene manager" on Ecosystem:

(http://i.imgur.com/ZvlaH3h.png)

Where is it?
Title: Re: (unity5.3.4+) Scene Manager
Post by: jeanfabre on January 24, 2017, 01:02:02 AM
Hi,
 
 I suspect they are gone because they haven't been moved from Snipt to Github ( different hosting for the Ecosystem, and snipt got shut down in december).

However, full SceneManager support is coming with 1.8.4 version. So keep an eye on the release, they'll be featured as default actions.

Bye,

 Jean