playMaker

Author Topic: (uniksy)how do i translate a find component and call its method?  (Read 2280 times)

sachaMagne

  • Playmaker Newbie
  • *
  • Posts: 9
Hi,
I just started playing with PM and wanted to translate unisky instance into a fsm.

The code is classic:
Code: [Select]
private UniSkyAPI uniSky;
private float timeOfDay;
private float speedOfTime = 0.4f;

public void Awake() {

// Define instance
GameObject uniSkyObject = GameObject.Find("UniSkyAPI");

uniSky = (UniSkyAPI) uniSkyObject.GetComponent(typeof(UniSkyAPI));
// Initiate and create default UniSky
uniSky.InstantiateUniSky();
I could find the game object and store it but can't figure how to access to InstantiateUniSky() and the others methods.

Thanks for your enlightenment

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: (uniksy)how do i translate a find component and call its method?
« Reply #1 on: April 03, 2013, 02:11:28 AM »
Hi,

you can use the action "sendMessage" or the action "invoke" have you tried that?

bye,

 Jean