mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-12 05:24:14 -05:00
Merge pull request #217 from dwango/fix/save_first_person
Save FirstPerson values on GUI correctly
This commit is contained in:
commit
fbd3cc4909
|
|
@ -1,6 +1,5 @@
|
|||
using UnityEditor;
|
||||
|
||||
|
||||
namespace VRM
|
||||
{
|
||||
[CustomEditor(typeof(VRMFirstPerson))]
|
||||
|
|
@ -16,13 +15,19 @@ namespace VRM
|
|||
return;
|
||||
}
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
|
||||
var worldOffset = head.localToWorldMatrix.MultiplyPoint(component.FirstPersonOffset);
|
||||
worldOffset = Handles.PositionHandle(worldOffset, head.rotation);
|
||||
|
||||
Handles.Label(worldOffset, "FirstPersonOffset");
|
||||
|
||||
component.FirstPersonOffset = head.worldToLocalMatrix.MultiplyPoint(worldOffset);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
Undo.RecordObject(component, "Changed FirstPerson");
|
||||
|
||||
component.FirstPersonOffset = head.worldToLocalMatrix.MultiplyPoint(worldOffset);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user