Answers for "unity get scene name by index"

C#
0

unity get scene name by index

private static string NameFromIndex(int BuildIndex)
 {
     string path = SceneUtility.GetScenePathByBuildIndex(BuildIndex);
     int slash = path.LastIndexOf('/');
     string name = path.Substring(slash + 1);
     int dot = name.LastIndexOf('.');
     return name.Substring(0, dot);
 }
Posted by: Guest on November-20-2020

C# Answers by Framework

Browse Popular Code Answers by Language