Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question How to create an array similar to the array on the Button component?

Discussion in 'Editor Workflows' started by NavaevDanila, Mar 22, 2023.

  1. NavaevDanila

    NavaevDanila

    Joined:
    Feb 14, 2023
    Posts:
    5
    I need to create an array in the inspector, similar to the array of a button component or some other UI elements. In them, you can select the object on which the script hangs and any method in this script.How to do it?

    P.S. Below is a screenshot of what I want to achieve.
     

    Attached Files:

  2. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,294
    Code (csharp):
    1. public UnityEvent onWhatever;
    See UnityEvent.