Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: kiriri on October 04, 2012, 01:13:13 PM
-
HEy,
anyone knows whether there's a way to sort a list of GameObjects alphabetically ? I'm somewhat slamming against a wall here. I looked at the code of the current sort action and it uses .Sort() which I think is for strings only. If you know another way to sort them I'm all ears :D
So far I've started to create a new action, but here's the said wall :S .
I want to use :
proxy.arrayList = proxy.arrayList.OrderBy( go => go.name ).ToArray();
but it returns some errors I really don't understand. The complete script and the errors are attached to this post.
I would really appreciate some help as I don't know heads from tails here :D
EDIT:
of course the second error seems clear, I mean , just remove the equation and leave the second part where it is, but how can it be changed by the function of the second part if it's read only?
[EDIT]
Ok, I found a way finally :) Please redownload the attached action, if all is well, I'll put it in the ecosystem package.
-
Hi,
it's outside my c# expertize, tried various things but none are working. I'll be trying some more.
bye,
Jean
-
oh, thanks for the reply, I'll skip it for now but it's sorely needed for inventory sorting, so I think I'm not the only one who needs it. For now I guess we'll have to write it to another list as strings, sort it and then get the individual indices and set the game objects in the original list accordingly... tedious and slow, but oh well.
One thing that may help is to actively define the type of key and value, as described here : http://msdn.microsoft.com/en-us/library/bb534966.aspx
I'll give it up though, been there tried that, can't make it work .
-
Hi,
It's coming with the next release of ArrayMaker :) I'll drop another post here when it's done.
Bye,
Jean
-
Hi,
ok, the action is now in the ArrayMaker Package on the Ecosystem
Bye,
Jean
-
Woohoo!