Inspectorの配列のElementのところをわかりやすくしたい
ことの発端はOculus OVRLipSyncを使って製作を行っているのですが、15種類の口形素(sil, PP, FF, TH, DD, kk, CH, SS, nn, RR, aa, E, ih, oh, ou)を配列のElementに入れていかないといけないが途中でわけがわからず、よく間違えるのでなんとかならないかなぁと

※この15個のElementです
EditorフォルダにPropertyDrawerの拡張を書く
Editorフォルダの中に以下のソースを入れる
NamedArrayDrawer.cs
using UnityEngine;
using UnityEditor;
[CustomPropertyDrawer(typeof(NamedArrayAttribute))]
public class NamedArrayDrawer : PropertyDrawer
{
    public override void OnGUI(Rect rect, SerializedProperty property, GUIContent label)
    {
        try
        {
            int pos = int.Parse(property.propertyPath.Split('[', ']')[1]);
            EditorGUI.PropertyField(rect, property, new GUIContent(((NamedArrayAttribute)attribute).names[pos]));
        }
        catch
        {
            EditorGUI.PropertyField(rect, property, label);
        }
    }
}
※Unity 5.4だとこの書き方
5.3だと【EditorGUI.PropertyField】→【EditorGUI.ObjecField】な気がします(未検証)
NamedArrayAttributeクラスの作成
適当なところにNamedArrayAttributeクラスを作成
NamedArrayAttribute.cs
using UnityEngine;
public class NamedArrayAttribute : PropertyAttribute
{
    public readonly string[] names;
    public NamedArrayAttribute(string[] names) { this.names = names; }
}
実際に使う
OVRLipSyncContextMorphTarget.cs内で該当する配列の上に拡張したAttributeを置く
OVRLipSyncContextMorphTarget.cs
    // Set the blendshape index to go to (-1 means there is not one assigned)
    [NamedArrayAttribute(new string[] { "sil", "PP", "FF", "TH", "DD", "kk", "CH", "SS", "nn", "RR", "aa", "E", "ih", "oh", "ou" })]  // ←追加
    public int[] VisemeToBlendTargets = new int[(int)OVRLipSync.ovrLipSyncViseme.Count];
できたもの
うん、これで間違えなくなりそう!
