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.
35 lines
1.2 KiB
35 lines
1.2 KiB
4 years ago
|
using UnityEngine;
|
||
|
using UnityEditor;
|
||
|
|
||
|
namespace UTJ.FrameCapturer
|
||
|
{
|
||
|
[CustomPropertyDrawer(typeof(AudioEncoderConfigs))]
|
||
|
class AudioEncoderConfigsDrawer : 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 ((AudioEncoder.Type)type.intValue)
|
||
|
{
|
||
|
case AudioEncoder.Type.Wave:
|
||
|
EditorGUILayout.PropertyField(property.FindPropertyRelative("waveEncoderSettings"), true);
|
||
|
break;
|
||
|
case AudioEncoder.Type.Ogg:
|
||
|
EditorGUILayout.PropertyField(property.FindPropertyRelative("oggEncoderSettings"), true);
|
||
|
break;
|
||
|
case AudioEncoder.Type.Flac:
|
||
|
EditorGUILayout.PropertyField(property.FindPropertyRelative("flacEncoderSettings"), true);
|
||
|
break;
|
||
|
}
|
||
|
EditorGUI.indentLevel--;
|
||
|
}
|
||
|
}
|
||
|
}
|