Added VRMFirstPersonEditor #66

This commit is contained in:
ousttrue
2018-12-27 15:32:58 +09:00
parent e43ce3e919
commit ce8c09c89d
2 changed files with 40 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
using UnityEditor;
namespace VRM
{
[CustomEditor(typeof(VRMFirstPerson))]
class VRMFirstPersonEditor : Editor
{
void OnSceneGUI()
{
var component = target as VRMFirstPerson;
var head = component.FirstPersonBone;
if (head == null)
{
return;
}
var worldOffset = head.localToWorldMatrix.MultiplyPoint(component.FirstPersonOffset);
worldOffset = Handles.PositionHandle(worldOffset, head.rotation);
Handles.Label(worldOffset, "FirstPersonOffset");
component.FirstPersonOffset = head.worldToLocalMatrix.MultiplyPoint(worldOffset);
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: e68be7adce7f09d4287af62a2bac63d7
timeCreated: 1545891764
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: