Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: finepointcgi on August 23, 2017, 11:09:49 AM

Title: Resources.Loadall[SOLVED]
Post by: finepointcgi on August 23, 2017, 11:09:49 AM
Hey guys,

I have an odd problem I need to load all of the materials in a file in my resources folder into an array and I cant seem to find an action that will load all of them. I found one that will allow me to load them each individually but not one that will do the entire thing at once. I have a script that can do it but i was wondering if playmaker could do it. Heres the gist of my code
   
Object[] obj;
      obj = Resources.LoadAll(path, typeof(Material));
      foreach (Object o in obj) {
         objects.Add (o);
Is there an action that I can use that would do this? Also im running into a massive lag problem when call those materials. Could I do a LoadAsyncAll? Would that fix it? Does playmaker have something like this?
Title: Re: Resources.Loadall
Post by: jeanfabre on August 24, 2017, 03:01:26 AM
Hi,

uhm, yes, I'll make an action for this. allow me few days and ping me on monday if I haven't got back here with an action ok?

 Bye,

 Jean
Title: Re: Resources.Loadall
Post by: jeanfabre on August 29, 2017, 02:59:56 AM
Hi,

 Here we go (https://twitter.com/JeanAtPlayMaker/status/902425082643058688), it's on the Ecosystem.

 There is no ResourcesLoadAll asynch mode unfortunatly, so you'll only get this version. for asynch, you need to load them individually.

 Bye,

 Jean
Title: Re: Resources.Loadall
Post by: markflorquin on April 08, 2019, 09:03:11 AM
Hi,

How can I access the objects stored in the array using arraymaker? I tried creating an array with the same name reference as the array that contains the materials (in my case). But this does not work. Array proxy remains empty, but the node shows all materials correctly loaded...

Any help is appreciated!
Mark
Title: Re: Resources.Loadall
Post by: markflorquin on April 08, 2019, 09:25:37 AM
Oh nevermind, I figured out it can be done using standard Array Get action. :)
Title: Re: Resources.Loadall
Post by: jeanfabre on April 11, 2019, 02:51:43 AM
Hi,

 Ok, cool :)

 Bye,

 Jean
Title: Re: Resources.Loadall[SOLVED]
Post by: Bennesky on July 30, 2019, 08:17:45 AM
Hi,

I found that the action (Resources Load all) not working, how to write asset path correctly, I try this ;
    - Assets/Resources/Textures
    - Resources/Textures
    - Textures
Nothing works, the Array variable stay null/empty, on the 'Textures' folder I put several  images... I got no problem with 'Resources Load' before..

Thanks..



Title: Re: Resources.Loadall[SOLVED]
Post by: jeanfabre on July 30, 2019, 08:48:27 AM
Hi,

 All good :)

(https://i.imgur.com/UhrrJgY.png)

are you sure you have your textures are not sprites?

Bye,

 Jean
Title: Re: Resources.Loadall[SOLVED]
Post by: Bennesky on July 30, 2019, 10:17:03 AM
Ok,

It's works , but only when the 'action' start at 'state1' , when I make it start at  'state2' after 'button down' or 'wait' transition its not work... what's wrong?

Thanks, btw it's already fix my problem..
Title: Re: Resources.Loadall[SOLVED]
Post by: jeanfabre on July 30, 2019, 12:30:02 PM
Hi,

 oh woah! that's really weird, I get it as well. I'll check with Alex on this.

 Bye,

 Jean
Title: Re: Resources.Loadall[SOLVED]
Post by: jeanfabre on July 30, 2019, 12:40:19 PM
Hi,

 ok, fixed. Can you download again from the Ecosystem, let me know how it goes.

 Bye,

 Jean
Title: Re: Resources.Loadall[SOLVED]
Post by: Bennesky on July 31, 2019, 12:32:22 AM
Hi,

Yes it's fixed, no more problem..

Thanks Jean for quick response...
Title: Re: Resources.Loadall[SOLVED]
Post by: Christoph on April 24, 2021, 03:59:04 PM
For me this action is not working in Unity 2019.4.21 and Playmaker 1.9.1.p5. Is it possible something related to Resources.LoadAll has changed?

(https://i.imgur.com/jWOjcKz.png)

No matter what, the array always stays empty.
Title: Re: Resources.Loadall[SOLVED]
Post by: Christoph on April 24, 2021, 04:40:10 PM
Got this confirmed by Brokn on discord that this action is broken (pun intended). Can we get a fix?
Title: Re: Resources.Loadall[SOLVED]
Post by: jeanfabre on May 10, 2021, 03:15:06 AM
Hi,

 ok, let me see what's going on with this. I'll get back to you when I can repro and have a fix.

Bye,

 Jean
Title: Re: Resources.Loadall[SOLVED]
Post by: jeanfabre on May 10, 2021, 06:56:57 AM
Hi,

ok, can you update from the Ecosystem and try again?

Bye,

 Jean
Title: Re: Resources.Loadall[SOLVED]
Post by: Lokefot on February 21, 2023, 06:05:39 AM
Hello,

Does anyone know if this action does not work anymore?
It returns empty on both "load all" and "load".
Title: Re: Resources.Loadall[SOLVED]
Post by: djaydino on February 21, 2023, 01:45:14 PM
Hi.
It should still work.

double check the path
Title: Re: Resources.Loadall[SOLVED]
Post by: Christoph on February 24, 2023, 10:56:12 PM
You might not want to use Resources Load All but rather Resources Load when you need something in particular. That's what I did in the end and is much more performant.