Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: FritsLyn on June 17, 2015, 03:24:49 PM

Title: No 'Sprite' variable = Not able to change sprites?[SOLVED]
Post by: FritsLyn on June 17, 2015, 03:24:49 PM
Hi,

If I want to have a series of images in a hash table, and via Playmaker change Sprites in uGUI, it appears there's a missing bridge in the current Playmaker functionality?

I can make workaraounds (not use sprites etc) and there's the almost obsolete FSM in the Ecosystem: 'U Gui Image Set Sprite' (obsolete because it's just as easy to just drag in the Sprite component into Playmaker and set it that way).

But it appears to me that since there's no 'Sprite' variable, then

A) Sprites cannot be stored in arrays (only Textures)
B) Sprites cannot be set in FSM's as variables (only by pointing at files directly)

This appears kind of like a missing bridge to me? Or am I missing something?

PS: It could be fixed by allowing 'GameObject' variable type to be used, I'd suppose?

:)

Thanks!
Title: Re: No 'Sprite' variable = Not able to change sprites?
Post by: mdotstrange on June 18, 2015, 12:15:54 AM
I was trying to do the same thing- using hash tables with sprites for an inventory system and couldn't get it working- ended up using texture variables with "raw image" in the ui instead-
Title: Re: No 'Sprite' variable = Not able to change sprites?
Post by: jeanfabre on June 23, 2015, 07:18:00 AM
Hi,

 Currently underWay, I'll push ArrayMaker update soon and it will feature sprites.

 Bye,

 Jean
Title: Re: No 'Sprite' variable = Not able to change sprites?
Post by: FritsLyn on June 23, 2015, 07:20:41 AM
You rock Jean! :)
Title: Re: No 'Sprite' variable = Not able to change sprites?
Post by: jeanfabre on June 23, 2015, 09:50:56 AM
Hi,

 Can you get the latest on the Ecosystem,

It now features Sprites support. Let me know if all goes ok.


Bye,

 Jean
Title: Re: No 'Sprite' variable = Not able to change sprites?
Post by: FritsLyn on June 23, 2015, 02:23:40 PM
I went into the Ecosystem

I searched for 'ArrayMaker'

I deleted it (red button)

I 'installed' it again.

Check - now, when I add a component, PlayMaker Hash Proxy, in the Prefill Type dropdown I can now chose a new type: Sprite.

But..

When I want to transport such a variable, even by 'raw Set Property' - I do not see how I can, since PlayMaker is not (as far as I can tell) supporting this variable type (Sprite).

So, it appears to me that now the source is there, but there's no way to handle it?
Title: Re: No 'Sprite' variable = Not able to change sprites?
Post by: Alex Chouls on June 23, 2015, 06:22:30 PM
You can use an Object variable for Sprites.
See attached image....
Title: Re: No 'Sprite' variable = Not able to change sprites?
Post by: FritsLyn on June 24, 2015, 02:55:10 AM
Oh! Thanks!
Title: Re: No 'Sprite' variable = Not able to change sprites?[SOLVED]
Post by: terri on June 24, 2015, 10:29:37 AM
trying the same thing, how does this work exactly?

because both with the U GUI Image Set Sprite from the ecosystem and with Set Property on the sprite component, it doesn't seem to be possible to set it as using an object variable?

Title: Re: No 'Sprite' variable = Not able to change sprites?[SOLVED]
Post by: jeanfabre on June 25, 2015, 07:28:48 AM
Hi

Your object type for your variable must be UnityEngine.Sprite. else it's not a sprite.

Bye,

 Jean
Title: Re: No 'Sprite' variable = Not able to change sprites?[SOLVED]
Post by: terri on June 25, 2015, 09:20:17 AM
I was having trouble because I missed the part where this is something I can change in the object variable.

That made it work, thanks!