Tim Cooper
8 年前
当前提交
32acc565
共有 17 个文件被更改,包括 221 次插入 和 339 次删除
-
2Assets/ScriptableRenderLoop/HDRenderPipeline/Editor/HDRenderPipelineInspector.cs
-
1Assets/ScriptableRenderLoop/HDRenderPipeline/Editor/HDRenderPipelineMenuItems.cs
-
150Assets/ScriptableRenderLoop/HDRenderPipeline/HDRenderPipeline.cs
-
2Assets/ScriptableRenderLoop/HDRenderPipeline/Lighting/TilePass/TilePass.cs
-
104Assets/ScriptableRenderLoop/HDRenderPipeline/SceneSettings/CommonSettings.cs
-
34Assets/ScriptableRenderLoop/HDRenderPipeline/SceneSettings/CommonSettingsSingleton.cs
-
10Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/HDRISky/HDRISkyParameters.cs
-
37Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/HDRISky/HDRISkyRenderer.cs
-
5Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/ProceduralSky/ProceduralSkyParameters.cs
-
35Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/ProceduralSky/ProceduralSkyRenderer.cs
-
52Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/SkyManager.cs
-
12Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/SkyParameters.cs
-
21Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/SkyParametersSingleton.cs
-
32Assets/ScriptableRenderLoop/HDRenderPipeline/Sky/SkyRenderer.cs
-
12Assets/ScriptableRenderLoop/core/Singleton.cs
-
39Assets/ScriptableRenderLoop/HDRenderPipeline/Editor/HDRenderPipeWindow.cs
-
12Assets/ScriptableRenderLoop/HDRenderPipeline/Editor/HDRenderPipeWindow.cs.meta
|
|||
using System.Linq; |
|||
using UnityEngine.SceneManagement; |
|||
|
|||
private CommonSettings.Settings settings { get; set; } |
|||
private CommonSettings settings { get; set; } |
|||
public static CommonSettings.Settings overrideSettings |
|||
public static CommonSettings overrideSettings |
|||
} |
|||
|
|||
protected override void OnEnable() |
|||
{ |
|||
SceneManager.activeSceneChanged += SceneManagerOnActiveSceneChanged; |
|||
} |
|||
|
|||
protected override void OnDisable() |
|||
{ |
|||
SceneManager.activeSceneChanged -= SceneManagerOnActiveSceneChanged; |
|||
set { instance.settings = value; } |
|||
|
|||
protected override void SceneManagerOnActiveSceneChanged(Scene from, Scene to) |
|||
{ |
|||
Refresh(); |
|||
} |
|||
|
|||
public static void Refresh() |
|||
{ |
|||
instance.settings = null; |
|||
|
|||
//TODO: Slow, and linq, make good and fast
|
|||
var overrideSettings = FindObjectsOfType<CommonSettings>().Where(x => x.isActiveAndEnabled && x.gameObject.scene == SceneManager.GetActiveScene()); |
|||
if (overrideSettings.Any()) |
|||
instance.settings = overrideSettings.FirstOrDefault().settings; |
|||
} |
|||
|
|||
} |
|||
} |
|
|||
using UnityEngine.Experimental.Rendering.HDPipeline; |
|||
using UnityEngine; |
|||
|
|||
namespace UnityEditor.Experimental.Rendering.HDPipeline |
|||
{ |
|||
public class HDRenderPipeWindow : EditorWindow |
|||
{ |
|||
|
|||
[MenuItem("HDRenderPipeline/Configure Overrides")] |
|||
static void ConfigureOverrides() |
|||
{ |
|||
GetWindow<HDRenderPipeWindow>().Show(); |
|||
} |
|||
|
|||
void OnGUI() |
|||
{ |
|||
CommonSettingsSingleton.overrideSettings = (CommonSettings)EditorGUILayout.ObjectField(new GUIContent("Common Settings"), CommonSettingsSingleton.overrideSettings, typeof(CommonSettings), false); |
|||
SkyParametersSingleton.overrideSettings = (SkyParameters)EditorGUILayout.ObjectField(new GUIContent("Sky Settings"), SkyParametersSingleton.overrideSettings, typeof(SkyParameters), false); |
|||
|
|||
if (GUILayout.Button("Create new common settings")) |
|||
{ |
|||
var instance = CreateInstance<CommonSettings>(); |
|||
AssetDatabase.CreateAsset(instance, "Assets/NewCommonSettings.asset"); |
|||
} |
|||
|
|||
if (GUILayout.Button("Create new HDRI sky params")) |
|||
{ |
|||
var instance = CreateInstance<HDRISkyParameters>(); |
|||
AssetDatabase.CreateAsset(instance, "Assets/NewHDRISkyParameters.asset"); |
|||
} |
|||
|
|||
if (GUILayout.Button("Create new Procedural sky params")) |
|||
{ |
|||
var instance = CreateInstance<ProceduralSkyParameters>(); |
|||
AssetDatabase.CreateAsset(instance, "Assets/NewProceduralSkyParameters.asset"); |
|||
} |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: a6a2e8d7ee3eb2c46962c9b49ff6c8ef |
|||
timeCreated: 1485262288 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue