Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: zombie_farm on October 02, 2013, 07:15:14 PM

Title: Send Message to script [SOLVED]
Post by: zombie_farm on October 02, 2013, 07: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?
(https://dl.dropboxusercontent.com/u/3080162/pauseExecute.png)

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;
   }
   

Title: Re: Send Message to script
Post by: jeanfabre on October 03, 2013, 02:03:33 AM
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
Title: Re: Send Message to script
Post by: zombie_farm on October 03, 2013, 01:46:12 PM
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
Title: Re: Send Message to script
Post by: zombie_farm on October 03, 2013, 02:00:41 PM
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?
Title: Re: Send Message to script
Post by: jeanfabre on October 04, 2013, 02:39:36 AM
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
Title: Re: Send Message to script (SOLVED)
Post by: zombie_farm on October 04, 2013, 06:47:08 PM
You ROCK!! thank you.
Title: Re: Send Message to script [SOLVED]
Post by: jessicajrs on November 15, 2015, 02: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?