First off are the globals from playMaker able to "communicate" with the scripts?
I'm playing around with different assets and trying to "plug" into them
right now I'm trying to hook into "lockpicking and hacking" asset from the store.
By default the asset is supplied with this, and it where i think i would want to hook in.
/// <summary>
/// Resets the dial sequence.
/// </summary>
public void Reset ()
{
// Count the dial reset value
dialResetCount += dialSpeed * Time.deltaTime;
// Reset the entire sequence if we move too much in the opposite direction
if( dialResetCount >= dialReset * 3.6f )
{
while( sequenceIndex > 0 )
{
sequenceIndex--;
direction *= -1;
}
dialResetCount = 0;
audio.PlayOneShot(soundReset);
}}
I have been working with globals across multiple FSM in playMaker and is great.
now with that experience i want to simple via this script above change a
global variable, maybe a bool just doing a flip or an int, changing a value counting failed attempts.
And then I'm going to make playMaker detect the change.
My problem is, how would i add,set,change a global var inside that function in such a way playMaker or anything else can read that var?
EDIT - UPDATE.
made a Bool for testing purposes, called "dialFail" default = false.
Ok added this to the script..
using HutongGames.PlayMaker; // at the top
and trying to figure out the FsmVariables....
tryed a few things, and ofcourse changed the global type accordingly.
1)
FsmVariables.GlobalVariables.BoolVariables("dialFail").....d.hmmm problems here..
I want to set or flip the bool value..
alternatly
2)
FsmVariables.GlobalVariables. <--- SetInt ? ? is that possible to set a
global int here.
3)
private string mytext = "test"; FsmVariables.GlobalsComponent.ToString("dialFail").mytext;