playMaker

Author Topic: Question about hideif attribute  (Read 1298 times)

cel

  • Full Member
  • ***
  • Posts: 132
Question about hideif attribute
« on: December 25, 2019, 06:47:14 AM »
Hi,

I'm was trying to hide some elements of an action and I came across the hideif attribute in the api documentation, but it doesn't provide an example,  when typing the code it says it requires string and test...

Could anyone provide a little example on how to make this attribute work, I've searched in most of the actions in playmaker and I couldn't find one that uses this.

Thanks in advance

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Question about hideif attribute
« Reply #1 on: December 26, 2019, 06:06:01 AM »
Hi,

 sure, basically, the attribute references a function which returns a bool:

Code: [Select]
namespace HutongGames.PlayMaker.Actions
{
    public class HideIfActionTest : FsmStateAction
    {
        [HideIf("HideMyString")]
        public FsmString MyString;

        public bool hide;


        public bool HideMyString()
        {
            return hide;
        }
    }
}


Bye,

 Jean