playMaker

Author Topic: Send Message to script [SOLVED]  (Read 2049 times)

zombie_farm

  • Playmaker Newbie
  • *
  • Posts: 37
    • View Profile
Send Message to script [SOLVED]
« on: October 02, 2013, 04:15:14 PM »
I have a plugin called easy movie texture its using  MediaPlayerCtrl.cs Im trying to Pause it by sending:

MediaPlayerCtrl.Instance.Pause() in the Method name..

I have 0% programing skills so ...what am I missing here?


in the MediaPlayerCtrl I think this is what Im getting at:

   
   public void Pause()
   {
      if(m_CurrentState == MEDIAPLAYER_STATE.PLAYING)
         Call_Pause();
      
      m_CurrentState = MEDIAPLAYER_STATE.PAUSED;
   }
   

« Last Edit: October 04, 2013, 03:48:13 PM by zombie_farm »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14373
  • Official Playmaker Support
    • View Profile
Re: Send Message to script
« Reply #1 on: October 02, 2013, 11:03:33 PM »
Hi,

 Unfortunatly, what you are trying to call is not a Unity message so that action will not work.

Have you wrote this script? do you have scripting knowledge?

 The key here will be to write either a custom action or modify the script to implement a proper message.

bye,

 Jean

zombie_farm

  • Playmaker Newbie
  • *
  • Posts: 37
    • View Profile
Re: Send Message to script
« Reply #2 on: October 03, 2013, 10:46:12 AM »
Ahh ok. I didn't write the script and don't have scripting knowledge. :(

So My friend who does know scripting..where would I tell him to look for a "proper message" ..could we send it to java first?

thanks
S

zombie_farm

  • Playmaker Newbie
  • *
  • Posts: 37
    • View Profile
Re: Send Message to script
« Reply #3 on: October 03, 2013, 11:00:41 AM »
and.. this is how its being called from a GUI button

if( GUI.Button(new Rect(50,500,100,100),"pause"))
      {
         MediaPlayerCtrl.Instance.Pause();
      }

can I replace GUI.Button with ....aaaa something PM will like?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14373
  • Official Playmaker Support
    • View Profile
Re: Send Message to script
« Reply #4 on: October 03, 2013, 11:39:36 PM »
Hi,

 Yes, you should only have a custom action that deals with MediaPlayerCtrl.Instance.Pause();

 and then you plug the rest normally using playmaker usual actions.

I have attached the custom action to do this. It's blind code as I don't have this MediaPlayerCtrl script but it should work.


 Bye,

 Jean

zombie_farm

  • Playmaker Newbie
  • *
  • Posts: 37
    • View Profile
Re: Send Message to script (SOLVED)
« Reply #5 on: October 04, 2013, 03:47:08 PM »
You ROCK!! thank you.

jessicajrs

  • Playmaker Newbie
  • *
  • Posts: 1
    • View Profile
Re: Send Message to script [SOLVED]
« Reply #6 on: November 15, 2015, 12:36:08 PM »
I had the same problem here and thought I found the solution when I found this post... But...

I tried importing the script but as soon as I throw it at unity the console gives me:
Assets/MediaPlayerCtrlPause.cs(14,41): error CS0117: `MediaPlayerCtrl' does not contain a definition for `Instance'

Using Unity 5.1. Any ideas?