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

How to access default reorderable list in inspector

Discussion in 'Scripting' started by JooJungYeol, Aug 4, 2021.

  1. JooJungYeol

    JooJungYeol

    Joined:
    Jul 15, 2013
    Posts:
    5
    hi.

    I want access default reorderable list;

    for example

    public class TestClass : Monobeaviour
    {
    [SerializeField]
    List<Vector3> positions = new List<Vector3>();
    }

    =================================
    upload_2021-8-4_11-35-6.png

    I want access this Reorderablelist's delegates, like onRemoveCallback, onSelectCallback,

    how can i access these fields.

    Am i create my custom ReorderableList?
    example
    ReorderableList list = new ReorderableList( serializedObject, serializedObject.FindProperty( "list" ) );

    Do anyone Have great idea??
     
  2. mikeohc

    mikeohc

    Joined:
    Jul 1, 2020
    Posts:
    215
    Are you asking how you'd display the list like unity's default inspector?

     EditorGUILayout.PropertyField


    can display the property.
     
  3. chatrat12

    chatrat12

    Joined:
    Jan 21, 2015
    Posts:
    122
    Would be nice! Hoping writing inspector GUI becomes much more enjoyable as UI toolkit/elements (whatever they are calling it) evolves.