Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

SuffixButtonAttribute

A topic by CatyboyStudio created Oct 14, 2022 Views: 70
Viewing posts 1 to 1

A Button is drawn at the end of the property, can set the size through “Width”

[SuffixButton("DebugLog", nameof(Check))]
public int Button1;
private void Check()
{
    Debug.Log(Button1);
}

 

The button can be set to Toggle mode, set the associated property or method through “Callback”

[SuffixButton("T1", nameof(Check1), Toggle = true)]
public int Toggle1;
 
private bool m_Checked;
private bool Check1()
{
    m_Checked = !m_Checked;
    Debug.Log("Check1=" + m_Checked);
    return m_Checked;
}

 The following definitions are supported for associative methods

  • bool Callback1() 
  • void Callback2(bool v)