playMaker

Author Topic: How to get a Fsm int global variable in C# code[SOLVED]  (Read 2844 times)

Grezod

  • Playmaker Newbie
  • *
  • Posts: 5
How to get a Fsm int global variable in C# code[SOLVED]
« 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#?
« Last Edit: March 24, 2016, 03:28:33 AM by jeanfabre »

SeriousRPG

  • Playmaker Newbie
  • *
  • Posts: 45
Re: How to get a Fsm int global variable in C# code
« Reply #1 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;

Grezod

  • Playmaker Newbie
  • *
  • Posts: 5
Re: How to get a Fsm int global variable in C# code
« Reply #2 on: March 23, 2016, 03:49:10 PM »
thx u bro!

play_edu

  • Full Member
  • ***
  • Posts: 116
Re: How to get a Fsm int global variable in C# code[SOLVED]
« Reply #3 on: January 03, 2017, 04:29:54 AM »
Thanks this help me a lot.