playMaker

Poll

U Gui Image Set Sprite cannot cast source type to destination

U Gui
0 (0%)
sprite
1 (100%)

Total Members Voted: 1

Author Topic: sprite object variable cannot cast source type to destination  (Read 1768 times)

skywaver

  • Playmaker Newbie
  • *
  • Posts: 1
sprite object variable cannot cast source type to destination
« on: December 07, 2015, 09:47:02 AM »
Hi~!

I have a sprite variable like follow:

Edit Variable   : sprite_var
Object type     : UnityEngine.Sprite
(not assigned sprite)

and.. at playmaker runtime states,

[v]  Set Object Value
object Variable : [sprite_var]
object Value : [some sprite from my project]

[v] U Gui Image Set Sprite
Game Object : [Use Owner]
Sprite           : [sprite_var]

then when I run, console says U Gui Image Set Sprite cannot cast source type to destination error, my button sprite image doesn't apply to button;;

Only directly assigning sprite from project to sprite variable or U Gui Image Set
Sprite action's sprite column. I want to use sprite variable:)

Can I solve this?




saru

  • Playmaker Newbie
  • *
  • Posts: 2
Re: sprite object variable cannot cast source type to destination
« Reply #1 on: December 16, 2015, 11:58:45 PM »
same problem here

saru

  • Playmaker Newbie
  • *
  • Posts: 2
Re: sprite object variable cannot cast source type to destination
« Reply #2 on: December 17, 2015, 12:29:10 AM »
ok, it seems the action has a tiny bug on line 48 in uGuiImageGetSprite.cs
the way i have it, it's like this:
       _image.sprite = (UnityEngine.Sprite)sprite.Value;
but it should really be like this
       sprite.Value = (UnityEngine.Sprite)_image.sprite;

hope it helps!