UnityEditor.Lightmapping.Bake C# (CSharp) Method

Bake() private method

private Bake ( ) : bool
return bool
        public static extern bool Bake();
        [MethodImpl(MethodImplOptions.InternalCall)]

Usage Example

示例#1
0
 public static void BakeMultipleScenes(string[] paths)
 {
     if (paths.Length == 0)
     {
         return;
     }
     for (int i = 0; i < paths.Length; i++)
     {
         for (int j = i + 1; j < paths.Length; j++)
         {
             if (paths[i] == paths[j])
             {
                 throw new Exception("no duplication of scenes is allowed");
             }
         }
     }
     if (!EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo())
     {
         return;
     }
     SceneSetup[] sceneManagerSetup = EditorSceneManager.GetSceneManagerSetup();
     EditorSceneManager.OpenScene(paths[0]);
     for (int k = 1; k < paths.Length; k++)
     {
         EditorSceneManager.OpenScene(paths[k], OpenSceneMode.Additive);
     }
     Lightmapping.Bake();
     EditorSceneManager.SaveOpenScenes();
     EditorSceneManager.RestoreSceneManagerSetup(sceneManagerSetup);
 }
All Usage Examples Of UnityEditor.Lightmapping::Bake