playMaker

Author Topic: Accessing array of c# bools  (Read 1648 times)

christougher

  • Playmaker Newbie
  • *
  • Posts: 36
Accessing array of c# bools
« on: June 17, 2016, 10:46:54 AM »
I have a c# script with a public array of bools.  I hope to use playmaker to read this list and populate an array of bools of it's own and then be able to set certain bools back in the c# script.  Get property and set property don't give the ability to read them as far as I can see and the playmaker array actions all are for FSM arrays.  How is it possible to grab/set variables within a c# array? Thx.

ergin

  • Junior Playmaker
  • **
  • Posts: 86
Re: Accessing array of c# bools
« Reply #1 on: June 17, 2016, 03:21:56 PM »
There are various ways to interchange and manipulate variables. One way is using "Send Message" to manipulate a value by starting a function.

just define a function in your script.
Code: [Select]
public void myfunction () {
// do something
}
then you can use Send Message with "myfunction" in method name.

Also you can receive variables with send message
Code: [Select]
public void myfunction (bool mybool) {
}
To send a bool value to a function just choose bool from parameter.

And to return a value from the function you can use
Code: [Select]
FsmVariables.GlobalVariables.GetFsmBool ("mybool").Value = true;remember to define "mybool" from global variables.

There are other ways, this is just one of them. Also remember to include:
Code: [Select]
using HutongGames.PlayMaker;