playMaker

Author Topic: Change sprite during runtime  (Read 2383 times)

ptrlo

  • Playmaker Newbie
  • *
  • Posts: 31
Change sprite during runtime
« on: October 16, 2014, 12:34:06 AM »
http://forum.unity3d.com/threads/changing-sprite-during-run-time.211817/

Like so, only in playmaker. Let's say I have 10 sprites and I want to trigger their swaps in playmaker. How do I go about doing that?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Change sprite during runtime
« Reply #1 on: October 16, 2014, 03:06:56 AM »

ptrlo

  • Playmaker Newbie
  • *
  • Posts: 31
Re: Change sprite during runtime
« Reply #2 on: October 16, 2014, 07:37:38 PM »
How do I add that playmaker script?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Change sprite during runtime
« Reply #3 on: October 20, 2014, 06:38:25 AM »
Hi,

 The easiest solution is to use the Ecosystem browser, it's an editor window, that lets you search for custom actions, and you can in one click have them downloaded and installed for you in your project.

otherwise, in this case, create a c# script in your assets browse ( in the Create button), name that script SwapSingleSprite ( the same name as the class), and then in that script, replace everything with the content of that thread code snippet.

Bye,

 Jean

ptrlo

  • Playmaker Newbie
  • *
  • Posts: 31
Re: Change sprite during runtime
« Reply #4 on: October 20, 2014, 09:38:12 PM »
Thanks! That sounds very handy!