Advertisement
Frank84

Get Enabled Levels

Jan 2nd, 2013
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.53 KB | None | 0 0
  1. protected static string[] GetEnabledScenePaths()
  2. {
  3.     if (EditorBuildSettings.scenes.Length > 0)
  4.     {
  5.         int i = 0;
  6.  
  7.         foreach (EditorBuildSettingsScene tScene in EditorBuildSettings.scenes)
  8.         {
  9.             if (tScene.enabled)
  10.             {
  11.                 i++;
  12.             }
  13.         }
  14.        
  15.         if (i > 0)
  16.         {
  17.             string[] levels = new string[i];
  18.             int idx = 0;
  19.  
  20.             foreach (EditorBuildSettingsScene tScene in EditorBuildSettings.scenes)
  21.             {
  22.                 if (tScene.enabled)
  23.                 {
  24.                     levels[idx++] = tScene.path;
  25.                 }
  26.             }
  27.  
  28.             return levels;
  29.         }
  30.     }
  31.    
  32.     return null;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement