Get specific component on gameobject after order in inspector

If i want to get a script according its number in the inspecter, how to i go about that? thinking something along the lines of


MonoBehaviour Components don’t really have any concept of what “order” they are in. The Inspector and the Unity Editor collect all of the components and display them in a somewhat predefined order, but that order and logic lives entirely outside your game and can be overridden in the Editor.

What, specifically, are you trying to do? It may be better to make references available in a prefab’s inspector (through making them public or using the [SerializeField] attribute) and assign the needed references specifically.