Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: cel on December 25, 2019, 06:47:14 AM

Title: Question about hideif attribute
Post by: cel 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
Title: Re: Question about hideif attribute
Post by: jeanfabre 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