playMaker

Author Topic: Custom actions: How to tell if a variable is a global? [Solved]  (Read 1749 times)

Tricky_Widget

  • Junior Playmaker
  • **
  • Posts: 62
I'm making a set of custom actions.  I need to be able to tell if a variable that my code gets is a global or not.  Is there any direct way to do this?  Or do I have to search through FsmVariables.GlobalVariables.typeVariables to see if there's a match?

Thanks!
« Last Edit: August 29, 2015, 10:53:15 AM by Tricky_Widget »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Custom actions: How to tell if a variable is a global?
« Reply #1 on: August 29, 2015, 10:51:42 AM »
You can use:

FsmVariables.GlobalVariables.Contains(variable);

There probably should be an IsGlobal property on the variable... I'll look into adding that...

Tricky_Widget

  • Junior Playmaker
  • **
  • Posts: 62
Re: Custom actions: How to tell if a variable is a global?
« Reply #2 on: August 29, 2015, 10:53:03 AM »
Ah, that makes more sense.

Thanks!


You can use:

FsmVariables.GlobalVariables.Contains(variable);

There probably should be an IsGlobal property on the variable... I'll look into adding that...