I’ve been trying to fill a Transform array using the EditorGUILayout but it won’t let me put any object in from either the project folder or the Hierarchy.
if(obstacleProperties._obstacleType!=ObstacleScript.ObstacleType.None)
{
obstacleProperties.participantCount = EditorGUILayout.IntField("Amount of Participants:", obstacleProperties.participantCount);
if(obstacleProperties.participantCount>0&&obstacleProperties.participantCount<=100)
{
obstacleProperties.participants=new Transform[obstacleProperties.participantCount];
for(int c=0;c<obstacleProperties.participantCount;c++)
{
obstacleProperties.participants[0]=(Transform)EditorGUILayout.ObjectField("Participant:",obstacleProperties.participants[0],typeof(Transform));
}
}
}
I’ve been doing the same things with just single Transforms and then it works like a charm. Everything in the array works, except for dragging the objects in. Does anyone know how I would be able to fix this?
Thanks in advance,
Tim