How to make an array with mulitple variables per entry that shows up in the editor?

I am working on a script that automatically instantiates some GameObjects when I start it, but I need a way of looping though the GameObjects and their additional aspects.

Things I de have set up is a function that spawns a GameObject given the variables:

Vector2Int position
int rotation
GameObject preset
Transform center

with the eventual position being

Vector3( position.x , 0 , position.y )

and rotation being

Quaternion.Euler( 0 , rotation * 90 , 0 )

Now I want to add a list (or array or whatever works better) visible and editable in the editor that will contain an entry for every object with all the information needed to spawn it in.

The line that calls the aforementioned method looks like this:

ShapeGen.generatePlayerComponent( item.position , rotation , part , player.transform ).transform.parent = player.transform;

Learn about structs and how to serialize them in Unity.

Something like:

[System.Serializabe]
public struct Data
{
    public Vector3 position;
}

Whenever you end with multiple (3+) properties to do something, it’s a good idea to encapsulate it in some class, so you can pass this class to method instead of multiple parameters, so you will end with something like

[Serializable]
public class MyEntry
{
	public Vector2Int position;
	public int rotation;
	public GameObject preset;
	public Transform center;
}

public class MyBehaviourClass : MonoBehaviour
{
	public List<MyEntry> myListOfEntries;
}

The important part here is to understand what unity CAN and what it CANT serialize (show in the inspector), all your fields (position, rotation, so on) are serializable by default, but not the custom class MyEntry, so you need to mark it with [Serializable] attribute to allow it to appear on the inspector