I want to make an array that looks like this image but cannot work out how to get for example a gameobject and an int into one element of an array.
1 Answer
You can do this by defining a custom class or struct containing multiple serialized fields and adding the Serializable attribute to it.
[Serializable]
public class ElementData
{
public GameObject gameObject;
public int amount;
}
Then you can define an array of this custom class.
public ElementData[] array;

[Serializable] public class ValuePair { public GameObject item; public int quantity; }and thenpublic ValuePair[] requirements;=> tadaaa? ... maybe worth looking some very basic tutorials about c# in general first? ;)