HeaderButton / HeaderLeftButtonDraw a button in the component header. Method which returns an IEnumerator will start a coroutine
Arguments:
string label = null: label of the button.nullmeans using function name. If starts with$, then a dynamic label will be created to use a field/property/callback as label. Dynamic label when returning null or empty string will hide the button. Rich Label supported.string toolTip = null: tool tip for the button.
using SaintsField; using SaintsField.ComponentHeader; [HeaderLeftButton] public void L1() { } [HeaderLeftButton("<color=brown><icon=star.png/>")] public void OnClickL2() { } [HeaderButton] public void R1() { Debug.Log("R1"); } [HeaderButton("<color=lime><icon=star.png/></color>+1", "Add a star")] public void StartAdd() { rate = (rate + 1) % 6; } [HeaderButton("<color=gray><icon=star.png/></color>-1", "Remove a star")] public void StartRemove() { rate = (rate - 1 + 6) % 6; // Debug.Log("OnClickR2"); } [Rate(1, 5)] public int rate;