I've run into a bit of trouble passing an array of transform objects to a constructor. It seems the way I've set it up its passing the correct array just empty and thats causing trouble further down the line. So here's the call to the constructor with the parameters:
items = new MenuItem(menuObjects.Find("Multiplayer"), [menuObjects.Find("Create"), menuObjects.Find("Join"), menuObjects.Find("QuickMatch")], 2);
The specific part that I believe is giving the trouble is the [menuObjects.Find("Create"), menuObjects.Find("Join"), menuObjects.Find("QuickMatch")] bit which is returning UnityEngine.Transform. I am honestly stumped, and I've tried a google search to find out a fix but I can't find a suitable alternative short of creating a variable and then storing them in there then passing them.
If anyone could help me it would be much appreciated.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a user guide.
If you are a new user, check out our FAQ for more information.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
For troubleshooting common problems with Unity 5.x Editor (including Win 10).
Answers and Comments
2 People are following this question.
Setting position of a transform?
Keep adding targets to a list
Instantiating from an object that's in an array
How to pass a Transform Array as an argument into a function in C#?
Sorting an Transforms array by gameobject name