Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started 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?
-
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
-
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
-
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
-
Oh nevermind, I figured out it can be done using standard Array Get action. :)
-
Hi,
Ok, cool :)
Bye,
Jean
-
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..
-
Hi,
All good :)
(https://i.imgur.com/UhrrJgY.png)
are you sure you have your textures are not sprites?
Bye,
Jean
-
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..
-
Hi,
oh woah! that's really weird, I get it as well. I'll check with Alex on this.
Bye,
Jean
-
Hi,
ok, fixed. Can you download again from the Ecosystem, let me know how it goes.
Bye,
Jean
-
Hi,
Yes it's fixed, no more problem..
Thanks Jean for quick response...
-
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.
-
Got this confirmed by Brokn on discord that this action is broken (pun intended). Can we get a fix?
-
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
-
Hi,
ok, can you update from the Ecosystem and try again?
Bye,
Jean
-
Hello,
Does anyone know if this action does not work anymore?
It returns empty on both "load all" and "load".
-
Hi.
It should still work.
double check the path
-
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.