Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Double sided slider in inspector

Discussion in 'Scripting' started by IC_, Jul 24, 2023.

  1. IC_

    IC_

    Joined:
    Jan 27, 2016
    Posts:
    61
    upload_2023-7-24_15-58-35.png

    How?
     
  2. KillDashNine

    KillDashNine

    Joined:
    Apr 19, 2020
    Posts:
    451
  3. IC_

    IC_

    Joined:
    Jan 27, 2016
    Posts:
    61
    Does EditorGUILayout work fine with inspector? I thought it doesn't like and refuses to work
     
  4. KillDashNine

    KillDashNine

    Joined:
    Apr 19, 2020
    Posts:
    451
    It's meant to be used with the Editor. And you need to code, it's not plug and play.

    Theres PropertyAttribute based implementations here and here. Dno if theyre the same.
     
    orionsyndrome and Bunny83 like this.
  5. Bunny83

    Bunny83

    Joined:
    Oct 18, 2010
    Posts:
    3,524
    You can use the layout system in a custom inspector without problems. However you can't / shouldn't use the layout system in property drawers as they would only work when used from within a custom inspector. However all Layout methods also exists in the EditorGUI class as the EditorGUILayout class simply wraps the layout system around the actual methods which use Rects to define the position. Here's EditorGUI.MinMaxSlider.
     
    orionsyndrome and KillDashNine like this.