Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: mhovland on May 15, 2013, 04:04:45 PM
-
Is there a way I'm not seeing for getting the name of the texture from a material, as a string?
Thanks for any pointers in the right direction.
-
For more clarity, I have the texture name as a string, and I need to convert it to a Texture, so I can set the texture component of an object.
Ex. I have "texture_00" stored in a string variable, I strip off the _00 and replace it with _05. Now I have "texture_05" stored in a string variable. How can I convert the string variable into a Texture variable, so I can use Set Property to change the texture? If there is a more direct way someone knows about, I am all ears.
Thanks again.
-
Hi,
ok, basically you can, ONLY if your textures are in a "Resources" folder and then you can load them at runtime by simply defining the path to it.
http://hutonggames.com/playmakerforum/index.php?topic=3916.msg18214;topicseen#msg18214
else, your texture need to be stored in a FsmVar. You can also use arrayMaker to store more texture conveniently, but that's less flexible then Resources.Load.
bye,
Jean
-
Thanks for the custom action Jean.
For even more clarity, I am using ArrayMaker to store all my textures, but I have two separate arrays, each with their own reference name.
Here is what I need to happen, when in certain states, I need to use the textures stored in the "main" ArrayList, and when in other states, I need to use the textures stored in the "alternate" ArrayList.
Is it possible to have two ArrayLists on the same GO, with the same reference name, and just enable or disable the appropriate list in the appropriate states? That would surely be easy to do, but it really is good for organizational purposes.
Thanks for your help.
m
-
Hi,
I would not recommand that, but this would work I guess. It's better to properly account for two different references in your logic.
bye,
Jean
-
This isn't directly applicable here it seems, but for reference:
GetFsmTextureName (http://hutonggames.com/playmakerforum/index.php?topic=6339.msg30885#msg30885)