PlayMaker Updates & Downloads > Share New Actions

Resources Load

(1/12) > >>

jeanfabre:
Hi Everyone,

 following a post: http://hutonggames.com/playmakerforum/index.php?topic=3904.msg18167#msg18167

Please find an action to load gameObjects, textures and materials from the resources folders in your assets based on the path of the asset.

Basically, this allow you to define the name of the asset using string, instead of having to maintain references. Also Working with Resources has special requirements, make sure you follow the guidelines:

http://docs.unity3d.com/Documentation/ScriptReference/Resources.html

[EDIT] new version with more checks to avoid error if resource is not found.
[EDIT: February 2014] now supported loading text assets in a FsmString.

Bye,

 Jean

junglist:
this is great Jean! Would you please make a variation of this action that works like  this:

http://answers.unity3d.com/questions/425609/can-you-instantiate-random-prefabs-from-the-resour.html

whydoidoit's answer fetches a random prefab from a specified folder inside resources. We can just use playmaker's create object to spawn.

jeanfabre:
Hi,

 you can do this already.

1: create the string representing your prefab name using actions such as "random int","int to string" and "build string"

2: inject that prefab name in "Resources Load" and done.

bye,

 Jean

junglist:
I just found this: http://hutonggames.com/playmakerforum/index.php?topic=3138.0

Combined with the actions you mentioned this will work. Thank you

jeanfabre:
Hi,
 
 I see, your issue was in finding out the number of prefabs in the resources. Thats' kind of dangerous cause you may have more prefabs in the end, not just the ones related to that particular feature.

bye,

 Jean

Navigation

[0] Message Index

[#] Next page

Go to full version