浏览代码

Merge pull request #769 from Unity-Technologies/scene-settings-serialization-fix

Fixed a serialization issue with scene settings
/main
GitHub 7 年前
当前提交
2680b9a5
共有 2 个文件被更改,包括 19 次插入4 次删除
  1. 15
      ScriptableRenderPipeline/Core/CoreRP/Editor/Volume/VolumeProfileFactory.cs
  2. 8
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/HDRenderPipelineMenuItems.cs

15
ScriptableRenderPipeline/Core/CoreRP/Editor/Volume/VolumeProfileFactory.cs


AssetDatabase.Refresh();
return profile;
}
public static T CreateVolumeComponent<T>(VolumeProfile profile, bool overrides = false, bool saveAsset = true)
where T : VolumeComponent
{
var comp = profile.Add<T>(overrides);
AssetDatabase.AddObjectToAsset(comp, profile);
if (saveAsset)
{
AssetDatabase.SaveAssets();
AssetDatabase.Refresh();
}
return comp;
}
}
class DoCreatePostProcessProfile : EndNameEditAction

8
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/HDRenderPipelineMenuItems.cs


Selection.activeObject = sceneSettings;
var profile = VolumeProfileFactory.CreateVolumeProfile(sceneSettings.scene, "Scene Settings");
profile.Add<HDShadowSettings>(true);
var visualEnv = profile.Add<VisualEnvironment>(true);
VolumeProfileFactory.CreateVolumeComponent<HDShadowSettings>(profile, true, false);
var visualEnv = VolumeProfileFactory.CreateVolumeComponent<VisualEnvironment>(profile, true, false);
profile.Add<ProceduralSky>(true);
profile.Add<ExponentialFog>(true);
VolumeProfileFactory.CreateVolumeComponent<ProceduralSky>(profile, true, false);
VolumeProfileFactory.CreateVolumeComponent<ExponentialFog>(profile, true, true);
var volume = sceneSettings.AddComponent<Volume>();
volume.isGlobal = true;

正在加载...
取消
保存