public Button[] not showing in inspector

Hello!
Is there a sort of “limit” for what can be showed in the inspector?

I have this:

public class GameEngine : MonoBehaviour
{

    public static GameEngine ge;

    [Header("Pulsanti")]

    public GameObject[] Btn;
    public Button[] pulsante;


    [Header("Testi")]

    public TextMeshProUGUI[] Btn_TXT;

    [Header("Strighe")]

    public string[] Frasi;


    public List<int> listaFrasiEstratte = new List<int>();
    public List<int> listaPulsantiEstratti = new List<int>();

    private int fraseEstratta, pulsanteEstratto, rispostaEsatta, pulsantiAssegnati, turno, pulsanteEsatto;
    private IEnumerator schermoErrore;

    public TextMeshProUGUI messaggio;
    public GameObject no;

As you can see there are some “public” stuff to be shown on the inspector but … the last I added on my script

public Button[] pulsante

is not showing in the inspector, even though I’ve try with [SerializeField] option

Do you have any tips for this issue?

Thanks a lot!

Would you mind sharing the top part of your script. The part that has all the using xxx; statements? My guess is that you’ve added UnityEngine.UIElements instead of the correct UnityEngine.UI namespace.

5 Likes
using System.Collections;
using System.Collections.Generic;
using System.Security.Cryptography;
using TMPro;
using UnityEngine;
using UnityEngine.Experimental.UIElements;
using UnityEngine.Experimental.XR;

You’re right! Now It works! I did not typed these statements … maybe it was added automatically!

Anyway it solved my problem! Thank you very much PraetorBlue!

1 Like