title: Unity EditorGUILayout IntSlider wont work
body: <p>Hey i want to create a Editor NavMesh Waypoint Path that the Developer can actually see. I wanted to use IntSliders for my values because it's easyer to work with instead of textfields but they are not moving like they are freezing.</p>
  
  <p>Before i added the sliders everything worked like expected, so i dont know where the mistake is, or i can't see it.</p>
  
  <p><a href="https://i.stack.imgur.com/RysWw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RysWw.png" alt="enter image description here"></a></p>
  
  <p>Here is my code, do i miss something?</p>
  
  <pre><code>using UnityEngine;
  using System.Collections;
  using UnityEditor;
  
  
  
  
      [CustomEditor(typeof(AIWaypointNetwork))]
      public class AIWaypointNetworkEditor : Editor 
      {
          public override void OnInspectorGUI()
          {
              AIWaypointNetwork network = (AIWaypointNetwork)target;
  
              network.DisplayMode = (PathDisplayMode)EditorGUILayout.EnumPopup("Display Mode", network.DisplayMode);
  
              if (network.DisplayMode == PathDisplayMode.Paths)
              {
                  network.UIStart = EditorGUILayout.IntSlider("Waypoint Start", network.UIStart, 0, network.Waypoints.Count - 1);
                  network.UIStart = EditorGUILayout.IntSlider("Waypoint End", network.UIEnd, 0, network.Waypoints.Count - 1);
              }
              DrawDefaultInspector();
          }
  
          void OnSceneGUI()
          {
              AIWaypointNetwork network = (AIWaypointNetwork)target;
  
              for (int i=0; i&lt;network.Waypoints.Count; i++) 
              {
                  if (network.Waypoints[i] != null)
                      Handles.Label (network.Waypoints [i].position, "Waypoint " + i.ToString ());
              }
  
              if (network.DisplayMode == PathDisplayMode.Connections)
              {
                  Vector3[] linePoints = new Vector3[network.Waypoints.Count + 1];
  
                  for (int i = 0; i &lt;= network.Waypoints.Count; i++)
                  {
                      int index = i != network.Waypoints.Count ? i : 0;
                      if (network.Waypoints [index] != null)
                          linePoints [i] = network.Waypoints [index].position;
                      else
                          linePoints [i] = new Vector3 (Mathf.Infinity, Mathf.Infinity, Mathf.Infinity);
                  }
                  Handles.color = Color.cyan;
                  Handles.DrawPolyLine (linePoints);
              } 
              else 
              if (network.DisplayMode == PathDisplayMode.Paths) 
              {
                  NavMeshPath path = new NavMeshPath();
  
                  if(network.Waypoints[network.UIStart]!=null &amp;&amp; network.Waypoints[network.UIEnd]!=null)
                  {
                      Vector3 from = network.Waypoints[network.UIStart].position;
                      Vector3 to = network.Waypoints[network.UIEnd].position;
  
                      NavMesh.CalculatePath(from, to, NavMesh.AllAreas, path);
                      Handles.color = Color.yellow;
                      Handles.DrawPolyLine(path.corners);
                  }
              }
          }
      }
  
  
  
  using UnityEngine;
  using System.Collections;
  using System.Collections.Generic;
  
  public enum PathDisplayMode { None, Connections, Paths }
  
  public class AIWaypointNetwork : MonoBehaviour 
  { 
      [HideInInspector]
      public PathDisplayMode DisplayMode = PathDisplayMode.Connections;
  
      [HideInInspector]
      public int UIStart = 0;
  
      [HideInInspector]
      public int UIEnd = 0;
  
      public List&lt;Transform&gt; Waypoints = new List&lt;Transform&gt; ();
  
  }
  </code></pre>