Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: kiriri on October 04, 2012, 01:13:13 PM

Title: ArrayMaker sort gameObject list[SOLVED]
Post 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 :
Code: [Select]
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.
Title: Re: ArrayMaker sort gameObject list
Post by: jeanfabre on October 05, 2012, 06:08:22 AM
Hi,

 it's outside my c# expertize, tried various things but none are working. I'll be trying some more.

bye,

 Jean
Title: Re: ArrayMaker sort gameObject list
Post by: kiriri on October 05, 2012, 06:52:06 AM
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 .
Title: Re: ArrayMaker sort gameObject list
Post by: jeanfabre on September 03, 2018, 03:30:13 AM
Hi,

 It's coming with the next release of ArrayMaker :) I'll drop another post here when it's done.


 Bye,

 Jean
Title: Re: ArrayMaker sort gameObject list
Post by: jeanfabre on September 19, 2018, 02:08:47 AM
Hi,

 ok, the action is now in the ArrayMaker Package on the Ecosystem

 Bye,

 Jean
Title: Re: ArrayMaker sort gameObject list[SOLVED]
Post by: Fat Pug Studio on September 19, 2018, 10:11:34 AM
Woohoo!