mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-06 05:07:47 -05:00
* MeshUtility を UniGLTF 下に移動 * Assets/VRM10 を追加 * JsonSchemaからのコード生成 UniGLTF/Editor/Generator を追加
41 lines
1.4 KiB
C#
41 lines
1.4 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
|
|
namespace UniVRM10
|
|
{
|
|
[CustomPropertyDrawer(typeof(RendererFirstPersonFlags))]
|
|
public class RendererFirstPersonFlagsDrawer : PropertyDrawer
|
|
{
|
|
static Rect LeftSide(Rect position, float width)
|
|
{
|
|
return new Rect(position.x, position.y, position.width-width, position.height);
|
|
}
|
|
static Rect RightSide(Rect position, float width)
|
|
{
|
|
return new Rect(position.x + (position.width-width), position.y, width, position.height);
|
|
}
|
|
|
|
public override void OnGUI(Rect position,
|
|
SerializedProperty property, GUIContent label)
|
|
{
|
|
var rendererProp = property.FindPropertyRelative("Renderer");
|
|
var flagProp = property.FindPropertyRelative("FirstPersonFlag");
|
|
|
|
const float WIDTH = 140.0f;
|
|
EditorGUI.PropertyField(LeftSide(position, WIDTH), rendererProp, new GUIContent(""), true);
|
|
EditorGUI.PropertyField(RightSide(position, WIDTH), flagProp, new GUIContent(""), true);
|
|
}
|
|
|
|
/*
|
|
public override float GetPropertyHeight(SerializedProperty property,
|
|
GUIContent label)
|
|
{
|
|
return 60.0f;
|
|
}
|
|
*/
|
|
}
|
|
}
|