浏览代码

fix ReflectionMenuItem

/main
RSlysz 6 年前
当前提交
382aad54
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 4
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/ReflectionMenuItem.cs

4
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/ReflectionMenuItem.cs


Selection.activeObject = plane;
var planarProbe = plane.AddComponent<PlanarReflectionProbe>();
planarProbe.influenceVolume.boxBaseSize = new Vector3(10, 0.01f, 10);
planarProbe.influenceVolume.boxSize = new Vector3(10, 0.01f, 10);
var hdrp = GraphicsSettings.renderPipelineAsset as HDRenderPipelineAsset;
var material = hdrp != null ? hdrp.GetDefaultMirrorMaterial() : null;

var parent = menuCommand.context as GameObject;
var go = CoreEditorUtils.CreateGameObject(parent, "Planar Reflection");
var planarProbe = go.AddComponent<PlanarReflectionProbe>();
planarProbe.influenceVolume.boxBaseSize = new Vector3(1, 0.01f, 1);
planarProbe.influenceVolume.boxSize = new Vector3(1, 0.01f, 1);
// Ensure it gets re-parented if this was a context click (otherwise does nothing)
GameObjectUtility.SetParentAndAlign(go, menuCommand.context as GameObject);
// Register the creation in the undo system

正在加载...
取消
保存