How to make a SerializedProperty with a list of values?

Hi

I am trying to make a custom editor with a slider, that only shows specific values.
e.g.: 5, 7,8,11,321,512.

From https://docs.unity3d.com/ScriptReference/EditorGUILayout.Slider.html it looks like that

public static void Slider(SerializedProperty property, float leftValue, float rightValue, params GUILayoutOption[] options);

is the function to use. But I do not find out how to make the SerializedProperty.

If you want to have a custom Slider, which shows an Array of integer Values (5, 7,8,11,321,512)
you need to do something like this:

136217-bildschirmfoto-2019-04-10-um-160941.png

Editor Script

using UnityEngine;
using UnityEditor;
[CustomEditor(typeof(Value))]
public class ValueEditor : Editor
{
    SerializedProperty intRange;
    float select = 0;   
    public override void OnInspectorGUI()
    {
        intRange = serializedObject.FindProperty("intRange");
        select = CustomIntSlider(intRange,select);
    }
    float CustomIntSlider(SerializedProperty property,float selected){
        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("My Slider",GUILayout.Width(100));
        selected = GUILayout.HorizontalSlider(Mathf.Round(selected),0,property.arraySize-1);
        EditorGUILayout.IntField(property.GetArrayElementAtIndex((int)selected).intValue,GUILayout.Width(50));
        EditorGUILayout.EndHorizontal();
        return selected;
    }
}

Monobehaviour

using System.Collections.Generic;
using UnityEngine;
[UnityEditor.CanEditMultipleObjects]
public class Value : MonoBehaviour
{
    public List<int> intRange = new List<int>(){5,7,8,11,321,512};
}