project tab unity
C#
#if UNITY_EDITOR
using UnityEngine;
using UnityEditor;
using UnityEditor.SceneManagement;
using System.Reflection;
// Latest version at https://bitbucket.org/snippets/pschraut/LeykeL
static class CopyLightingSettings
{
//
// Written by Peter Schraut
// http://www.console-dev.de
//
// This Unity editor extension allows you to copy&paste lighting settings
// from one scene to another. Check the following video to see it in action
// https://youtu.be/-TQzrVn1kWM
//
// Save this file as "Assets/Editor/CopyLightingSettings.cs"
//
// Download most recent version from:
// https://bitbucket.org/snippets/pschraut/LeykeL
//
static SerializedObject s_SourceLightmapSettings;
static SerializedObject s_SourceRenderSettings;
#if UNITY_2018_2_OR_NEWER
const string k_CopySettingsMenuPath = "Window/Rendering/Copy Lighting Settings";
const string k_PasteSettingsMenuPath = "Window/Rendering/Paste Lighting Settings";
const string k_PasteSettingsAllMenuPath = "Window/Rendering/Paste Lighting Settings in open Scenes";
#else
const string k_CopySettingsMenuPath = "Window/Lighting/Copy Settings";
const string k_PasteSettingsMenuPath = "Window/Lighting/Paste Settings";
const string k_PasteSettingsAllMenuPath = "Window/Lighting/Paste Settings in open Scenes";
#endif
[MenuItem(k_CopySettingsMenuPath, priority = 200)]
static void CopySettings()
{
UnityEngine.Object lightmapSettings;
if (!TryGetSettings(typeof(LightmapEditorSettings), "GetLightmapSettings", out lightmapSettings))
return;
UnityEngine.Object renderSettings;
if (!TryGetSettings(typeof(RenderSettings), "GetRenderSettings", out renderSettings))
return;
s_SourceLightmapSettings = new SerializedObject(lightmapSettings);
s_SourceRenderSettings = new SerializedObject(renderSettings);
}
[MenuItem(k_PasteSettingsMenuPath, priority = 201)]
static void PasteSettings()
{
UnityEngine.Object lightmapSettings;
if (!TryGetSettings(typeof(LightmapEditorSettings), "GetLightmapSettings", out lightmapSettings))
return;
UnityEngine.Object renderSettings;
if (!TryGetSettings(typeof(RenderSettings), "GetRenderSettings", out renderSettings))
return;
CopyInternal(s_SourceLightmapSettings, new SerializedObject(lightmapSettings));
CopyInternal(s_SourceRenderSettings, new SerializedObject(renderSettings));
UnityEditorInternal.InternalEditorUtility.RepaintAllViews();
}
[MenuItem(k_PasteSettingsAllMenuPath, priority = 202)]
static void PasteSettingsAll()
{
var activeScene = EditorSceneManager.GetActiveScene();
try
{
for (var n = 0; n < EditorSceneManager.sceneCount; ++n)
{
var scene = EditorSceneManager.GetSceneAt(n);
if (!scene.IsValid() || !scene.isLoaded)
continue;
EditorSceneManager.SetActiveScene(scene);
PasteSettings();
}
}
finally
{
EditorSceneManager.SetActiveScene(activeScene);
}
}
[MenuItem(k_PasteSettingsAllMenuPath, validate = true)]
[MenuItem(k_PasteSettingsMenuPath, validate = true)]
static bool PasteValidate()
{
return s_SourceLightmapSettings != null && s_SourceRenderSettings != null;
}
static void CopyInternal(SerializedObject source, SerializedObject dest)
{
var prop = source.GetIterator();
while (prop.Next(true))
{
var copyProperty = true;
foreach (var propertyName in new[] { "m_Sun", "m_FileID", "m_PathID", "m_ObjectHideFlags" })
{
if (string.Equals(prop.name, propertyName, System.StringComparison.Ordinal))
{
copyProperty = false;
break;
}
}
if (copyProperty)
dest.CopyFromSerializedProperty(prop);
}
dest.ApplyModifiedProperties();
}
static bool TryGetSettings(System.Type type, string methodName, out UnityEngine.Object settings)
{
settings = null;
var method = type.GetMethod(methodName, BindingFlags.Static | BindingFlags.NonPublic);
if (method == null)
{
Debug.LogErrorFormat("CopyLightingSettings: Could not find {0}.{1}", type.Name, methodName);
return false;
}
var value = method.Invoke(null, null) as UnityEngine.Object;
if (value == null)
{
Debug.LogErrorFormat("CopyLightingSettings: Could get data from {0}.{1}", type.Name, methodName);
return false;
}
settings = value;
return true;
}
}
#endif
Also in C#:
- Title
- c# initialize empty array
- Category
- C#
- Title
- c# string remove special characters
- Category
- C#
- Title
- how to do a messagebox in c#
- Category
- C#
- Title
- create object in c#
- Category
- C#
- Title
- c# replace string case insensitive
- Category
- C#
- Title
- c# arrays of arrays
- Category
- C#
- Title
- C# array index tostring
- Category
- C#
- Title
- multidimensional meaning
- Category
- C#
- Title
- how to set progress openedge driver name for odbc connection c#
- Category
- C#
- Title
- hot to move pobject unity
- Category
- C#
- Title
- unity fps counter
- Category
- C#
- Title
- C# get pc language
- Category
- C#
- Title
- how to check if textbox is empty in c#
- Category
- C#
- Title
- why is c# say ; expected
- Category
- C#
- Title
- how to add a gameobject
- Category
- C#
- Title
- c# array inst working
- Category
- C#
- Title
- Net.ServicePointManager.SecurityProtocol .net framework 4
- Category
- C#
- Title
- c# exit for
- Category
- C#
- Title
- degree to radians c#
- Category
- C#
- Title
- first sentence letter capital in c#
- Category
- C#
- Title
- make camera follow character unity 2020
- Category
- C#
- Title
- reverse string c#
- Category
- C#
- Title
- unity enable gameobject
- Category
- C#
- Title
- c# dictionary get value by key
- Category
- C#
- Title
- c# if statement
- Category
- C#
- Title
- int to ascii c#
- Category
- C#
- Title
- c# string methods
- Category
- C#
- Title
- cursorlockmode cannot be used as a method C#
- Category
- C#
- Title
- c# list to string comma separated
- Category
- C#
- Title
- unity inspector header attribute
- Category
- C#
- Title
- split using string c#
- Category
- C#
- Title
- how to add array to list in c#
- Category
- C#
- Title
- new TextractDocument(results)
- Category
- C#
- Title
- unity instantiate
- Category
- C#
- Title
- unity 3d character controller
- Category
- C#
- Title
- f string C#
- Category
- C#
- Title
- unity3d find y position on navmesh
- Category
- C#
- Title
- unity up arrow input
- Category
- C#
- Title
- c# string to character array
- Category
- C#
- Title
- f reachable queue in c#
- Category
- C#
- Title
- how to detected WindowCloseEvent in other window wpf
- Category
- C#
- Title
- c# how to have a multiline console.writeline
- Category
- C#
- Title
- unity making homing missile
- Category
- C#
- Title
- c# odd even median
- Category
- C#
- Title
- download and run exe c# 1 button
- Category
- C#
- Title
- unity transfoprm position y change
- Category
- C#
- Title
- bool toggle unity c#
- Category
- C#
- Title
- c# how to initialize an array
- Category
- C#
- Title
- unity rigidbody constraints
- Category
- C#
- Title
- unity get scrollbar value
- Category
- C#
- Title
- unity get max occurrence in list
- Category
- C#
- Title
- unity how to set an objects postion x,y,z
- Category
- C#
- Title
- if get key down unity
- Category
- C#
- Title
- get number of sundays in a month c#
- Category
- C#
- Title
- c sharp comments
- Category
- C#
- Title
- unity multiply xyz of two vectors
- Category
- C#
- Title
- c# mixed multidimensional array
- Category
- C#
- Title
- unity scene name get
- Category
- C#
- Title
- and unity
- Category
- C#
- Title
- define enum c#
- Category
- C#
- Title
- nunit return parameter
- Category
- C#
- Title
- strtorime online
- Category
- C#
- Title
- c# summary tag
- Category
- C#
- Title
- using serial port in c#
- Category
- C#
- Title
- c# console writeline color
- Category
- C#
- Title
- c# inline initialize dictionary
- Category
- C#
- Title
- lazy loading c#
- Category
- C#
- Title
- two players one phone unity gamne
- Category
- C#
- Title
- unity quaternion identity
- Category
- C#
- Title
- max of array C#
- Category
- C#
- Title
- Unity if object doens't exist
- Category
- C#
- Title
- c sharp tryparse
- Category
- C#
- Title
- creating a c# class
- Category
- C#
- Title
- how to add to a list c#
- Category
- C#
- Title
- C# .net core convert string to enum
- Category
- C#
- Title
- enums as numbers c#
- Category
- C#
- Title
- c# System.Resources.MissingManifestResourceException error
- Category
- C#
- Title
- c# else if
- Category
- C#
- Title
- c# creating a data recovery software
- Category
- C#
- Title
- how to pass object as test case in nunit c#
- Category
- C#
- Title
- c# enum variable set to nonthing
- Category
- C#
- Title
- generics in c#
- Category
- C#
- Title
- unity load next scene
- Category
- C#
- Title
- vector3.lerp
- Category
- C#
- Title
- autofixture ignore property
- Category
- C#
- Title
- c# web form compare dates
- Category
- C#
- Title
- draw sphere cast unity with program
- Category
- C#
- Title
- get random number c#
- Category
- C#
- Title
- POST http://localhost:5001/api/v1/identity/login 500 (Internal Server Error) LoginForm.jsx:39 Error: Request failed with status code 500 at createError (createError.js:16) at settle (settle.js:17) at XMLHttpRequest.handleLoad (xhr.js:61)
- Category
- C#
- Title
- animator hash in unity
- Category
- C#
- Title
- .net 4.5 use tls 1.2
- Category
- C#
- Title
- unity3d invector expand fsm controller
- Category
- C#
- Title
- wpf make size fill all grid
- Category
- C#
- Title
- list of vectors c#
- Category
- C#
- Title
- convert string to decimal c#
- Category
- C#
- Title
- c# arraylist
- Category
- C#
- Title
- button commandfield commandargument pass textbox
- Category
- C#
- Title
- Failed to retrieve Firebase Instance Id
- Category
- C#
- Title
- c# to binary
- Category
- C#
- Title
- c# iorderedenumerable to dictionary
- Category
- C#