This commit is contained in:
yutopp
2019-03-11 16:18:02 +09:00
parent 1b36bee647
commit c56ca52bbb

View File

@@ -1,4 +1,5 @@
using UnityEditor;
using UnityEngine;
namespace VRM
@@ -16,12 +17,17 @@ namespace VRM
return;
}
EditorGUI.BeginChangeCheck();
var worldOffset = head.localToWorldMatrix.MultiplyPoint(component.FirstPersonOffset);
worldOffset = Handles.PositionHandle(worldOffset, head.rotation);
Handles.Label(worldOffset, "FirstPersonOffset");
if (EditorGUI.EndChangeCheck())
{
Undo.RecordObject(component, "Changed FirstPerson");
}
component.FirstPersonOffset = head.worldToLocalMatrix.MultiplyPoint(worldOffset);
}
}