Exemple #1
0
        private void DrawSoundSetElement(Rect rect, int index, bool isActive, bool isFocused)
        {
            string textureName = soundsSets.GetPropertyOfIndex(index, "TextureName").stringValue;

            Object soundsSet = soundsSets.GetPropertyOfIndex(index, "soundsSet").objectReferenceValue;

            soundsSets.GetPropertyOfIndex(index, "soundsSet").objectReferenceValue =
                EditorGUI.ObjectField(GUILayoutArea.ProgressSingleLineHeight(ref rect), textureName, soundsSet, typeof(ControllerSoundStates), false);
        }
Exemple #2
0
    public InspectorList(SerializedProperty property) : base(property.serializedObject, property)
    {
        label = property.displayName;

        drawHeaderCallback = delegate(Rect rect)
        {
            if (EditorGUI.indentLevel == 0)
            {
                rect.x     += 10;
                rect.width -= 10;
            }
            else
            {
                rect.x = 0f;
                rect   = EditorGUI.IndentedRect(rect);
            }

            property.isExpanded = EditorGUI.Foldout(rect, property.isExpanded, label, true);
        };
        drawElementCallback = delegate(Rect rect, int index, bool isActive, bool isFocused)
        {
            EditorGUI.PropertyField(GUILayoutArea.ProgressSingleLineHeight(ref rect), GetArrayElement(index), new GUIContent());
        };
    }
 public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
 {
     EditorGUI.PropertyField(GUILayoutArea.ProgressSingleLineHeight(ref position), property.FindPropertyRelative("prefab"), new GUIContent(label));
 }
Exemple #4
0
    public virtual void Draw(ref Rect rect)
    {
        selectedIndex = EditorGUI.Popup(GUILayoutArea.ProgressSingleLineHeight(ref rect), property.displayName, selectedIndex, displayNames);

        ProcessValue();
    }