浏览代码

Remove unused HDReflectionProbeEditor.Handles

/main
RSlysz 6 年前
当前提交
6abedb1b
共有 2 个文件被更改,包括 0 次插入73 次删除
  1. 11
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Handles.cs.meta
  2. 62
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Handles.cs

11
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Handles.cs.meta


fileFormatVersion: 2
guid: e389a5db9b96c2a4ba5f60f6a402d6f4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

62
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/HDReflectionProbeEditor.Handles.cs


using UnityEditor.IMGUI.Controls;
using UnityEditorInternal;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.Rendering.HDPipeline;
using UnityEditor.Experimental.Rendering.HDPipeline;
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
partial class HDReflectionProbeEditor
{
enum InfluenceType
{
Standard,
Normal
}
protected override void OnSceneGUI()
{
base.OnSceneGUI();
var s = m_UIState;
var p = m_SerializedHDProbe as SerializedHDReflectionProbe;
var o = this;
if(EditMode.editMode == EditMode.SceneViewEditMode.ReflectionProbeOrigin)
{
Handle_OriginEditing(s, p, o);
}
}
static void Handle_OriginEditing(HDReflectionProbeUI s, SerializedHDReflectionProbe sp, Editor o)
{
var p = (ReflectionProbe)sp.serializedLegacyObject.targetObject;
var transformPosition = p.transform.position;
var size = p.size;
EditorGUI.BeginChangeCheck();
var newPostion = Handles.PositionHandle(transformPosition, HDReflectionProbeEditorUtility.GetLocalSpaceRotation(p));
var changed = EditorGUI.EndChangeCheck();
if (changed || s.oldLocalSpace != HDReflectionProbeEditorUtility.GetLocalSpace(p))
{
var localNewPosition = s.oldLocalSpace.inverse.MultiplyPoint3x4(newPostion);
var b = new Bounds(p.center, size);
localNewPosition = b.ClosestPoint(localNewPosition);
Undo.RecordObject(p.transform, "Modified Reflection Probe Origin");
p.transform.position = s.oldLocalSpace.MultiplyPoint3x4(localNewPosition);
Undo.RecordObject(p, "Modified Reflection Probe Origin");
p.center = HDReflectionProbeEditorUtility.GetLocalSpace(p).inverse.MultiplyPoint3x4(s.oldLocalSpace.MultiplyPoint3x4(p.center));
EditorUtility.SetDirty(p);
s.UpdateOldLocalSpace(p);
}
}
}
}
正在加载...
取消
保存