Beispiel #1
0
        public void OnGUI()
        {
            EditorGUIUtility.hierarchyMode = true;

            lightmapSettings.Update();

            m_ScrollPosition = EditorGUILayout.BeginScrollView(m_ScrollPosition);

            EditorGUILayout.PropertyField(m_LightingSettingsAsset);

            EditorGUILayout.Space();
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();

            if (GUILayout.Button(Styles.newLightingSettings, GUILayout.Width(170)))
            {
                var ls = new LightingSettings();
                ls.name = "New Lighting Settings";
                Undo.RecordObject(m_LightmapSettings.targetObject, "New Lighting Settings");
                Lightmapping.lightingSettingsInternal = ls;
                ProjectWindowUtil.CreateAsset(ls, (ls.name + ".lighting"));
            }

            GUILayout.EndHorizontal();
            EditorGUILayout.Space();

            m_BakeSettings.OnGUI();
            WorkflowSettingsGUI();

            EditorGUILayout.EndScrollView();
            EditorGUILayout.Space();

            lightmapSettings.ApplyModifiedProperties();
        }
        void LightingSettingsGUI()
        {
            m_ShowLightingSettings.value = EditorGUILayout.FoldoutTitlebar(m_ShowLightingSettings.value, Styles.lightingSettings, true);

            if (m_ShowLightingSettings.value)
            {
                ++EditorGUI.indentLevel;

                EditorGUILayout.PropertyField(m_LightingSettingsAsset, GUIContent.Temp("Lighting Settings Asset"));

                EditorGUILayout.Space();
                GUILayout.BeginHorizontal();
                GUILayout.FlexibleSpace();

                if (GUILayout.Button(Styles.newLightingSettings, GUILayout.Width(170)))
                {
                    var ls = new LightingSettings();
                    ls.name = "New Lighting Settings";
                    Undo.RecordObject(m_LightmapSettings.targetObject, "New Lighting Settings");
                    Lightmapping.lightingSettingsInternal = ls;
                    ProjectWindowUtil.CreateAsset(ls, (ls.name + ".lighting"));
                }

                GUILayout.EndHorizontal();
                EditorGUILayout.Space();

                --EditorGUI.indentLevel;
            }
        }
Beispiel #3
0
        public static bool TryGetLightingSettings(out LightingSettings settings)
        {
            settings = lightingSettingsInternal;

            return(settings != null);
        }
 private extern static void Internal_Create([Writable] LightingSettings self);
 public static extern void SetLightingSettingsForScenes(Scene[] scenes, LightingSettings lightingSettings);