Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

How do I detect if a scene name is valid?

$
0
0
I'm setting up scripts to load scenes in the background. I want my loading script to verify that the scene it needs to load is valid in the start function rather than waiting until I try to load the scene.

I thought I could use scenemanager.getscenebyname and just see if that returns a null reference, but alas, it does not. It returns "an invalid scene" according to the documentation, and I don't know how to check that.

How can I determine if a scene name is valid?

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>