Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Grezod on March 22, 2016, 09:21:23 AM

Title: How to get a Fsm int global variable in C# code[SOLVED]
Post by: Grezod on March 22, 2016, 09:21:23 AM
i'm a rookie in uinty

i use playmaker create a int global variable name "Score"

but i dont know how to set a variable in C# and value same with Score

can some one post me a detail code use in C# like

"int score = XXXXXXXXXXXXX(Score)"

and where i can know about playmaker code in C#?
Title: Re: How to get a Fsm int global variable in C# code
Post by: SeriousRPG on March 22, 2016, 03:15:16 PM
Set up the Using references:
using HutongGames.PlayMaker;
using HutongGames.PlayMaker.Actions;

Declare your variables:
public PlayMakerFSM theFSM;
private Texture2D FSMvar;

Then reference them: (this is setting a texture FSM variable from another tex and myObj represents the object that has the FSM I want to talk to)
theFSM = myObj.GetComponent<PlayMakerFSM>();
theFSM.FsmVariables.GetFsmTexture("newInventoryItem").Value =tex;
Title: Re: How to get a Fsm int global variable in C# code
Post by: Grezod on March 23, 2016, 03:49:10 PM
thx u bro!
Title: Re: How to get a Fsm int global variable in C# code[SOLVED]
Post by: play_edu on January 03, 2017, 04:29:54 AM
Thanks this help me a lot.