网上演练贵港万达广场(人员密集)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.6 KiB

4 years ago
using UnityEngine;
using UnityEditor;
namespace UTJ.FrameCapturer
{
[CustomPropertyDrawer(typeof(MovieEncoderConfigs))]
class MovieEncoderConfigsDrawer : PropertyDrawer
{
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
{
return 0.0f;
}
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
var type = property.FindPropertyRelative("format");
EditorGUILayout.PropertyField(type);
EditorGUI.indentLevel++;
switch ((MovieEncoder.Type)type.intValue)
{
case MovieEncoder.Type.Png:
EditorGUILayout.PropertyField(property.FindPropertyRelative("pngEncoderSettings"), true);
break;
case MovieEncoder.Type.Exr:
EditorGUILayout.PropertyField(property.FindPropertyRelative("exrEncoderSettings"), true);
break;
case MovieEncoder.Type.Gif:
EditorGUILayout.PropertyField(property.FindPropertyRelative("gifEncoderSettings"), true);
break;
case MovieEncoder.Type.WebM:
EditorGUILayout.PropertyField(property.FindPropertyRelative("webmEncoderSettings"), true);
break;
case MovieEncoder.Type.MP4:
EditorGUILayout.PropertyField(property.FindPropertyRelative("mp4EncoderSettings"), true);
break;
}
EditorGUI.indentLevel--;
}
}
}