playMaker

Author Topic: ArrayMaker sort gameObject list[SOLVED]  (Read 2319 times)

kiriri

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
ArrayMaker sort gameObject list[SOLVED]
« on: October 04, 2012, 10:13:13 AM »
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.
« Last Edit: September 18, 2018, 11:08:56 PM by jeanfabre »
Best,
Sven

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14595
  • Official Playmaker Support
    • View Profile
Re: ArrayMaker sort gameObject list
« Reply #1 on: October 05, 2012, 03: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

kiriri

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
Re: ArrayMaker sort gameObject list
« Reply #2 on: October 05, 2012, 03: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 .
Best,
Sven

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14595
  • Official Playmaker Support
    • View Profile
Re: ArrayMaker sort gameObject list
« Reply #3 on: September 03, 2018, 12: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

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14595
  • Official Playmaker Support
    • View Profile
Re: ArrayMaker sort gameObject list
« Reply #4 on: September 18, 2018, 11:08:47 PM »
Hi,

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

 Bye,

 Jean

krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 992
    • View Profile
    • Fat Pug Studio
Re: ArrayMaker sort gameObject list[SOLVED]
« Reply #5 on: September 19, 2018, 07:11:34 AM »
Woohoo!