简体   繁体   中英

Unity - If scene name starts with

I would like to know if there is a way how I can check if the current scene starts with "3.". I have several gamemodes with their own scenes. Gamemode 1 scenes start with "1." (eg 1.1, 1.2, 1.3). Now I want to check if the scene is using gamemode three by saying if(CurrentScene starts with "3.") . How should I do this?

if( SceneManager.GetActiveScene().name.StartsWith("3.") )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM