JUtils
A unity utilities library
JUtils.ButtonAttribute Class Reference

Attach this button to a method to make it clickable in the inspector. This attribute will also draw parameters if it can. More...

Inheritance diagram for JUtils.ButtonAttribute:
Collaboration diagram for JUtils.ButtonAttribute:

Public Member Functions

 ButtonAttribute ([CanBeNull] string name=null, bool clickableInEditor=false)
 Create an inspector button for this atribute More...
 

Public Attributes

readonly string name
 
bool clickableInEditor
 

Detailed Description

Attach this button to a method to make it clickable in the inspector. This attribute will also draw parameters if it can.

namespace Example
{
public class ButtonExample : MonoBehaviour
{
[Button]
public void SimpleButton() {
Debug.Log("The Simple button has been pressed");
}
}
}

Constructor & Destructor Documentation

◆ ButtonAttribute()

JUtils.ButtonAttribute.ButtonAttribute ( [CanBeNull] string  name = null,
bool  clickableInEditor = false 
)
inline

Create an inspector button for this atribute

Parameters
nameThe name of the button
clickableInEditorShould the button only run in playmode

References JUtils.ButtonAttribute.clickableInEditor, and JUtils.ButtonAttribute.name.

Member Data Documentation

◆ clickableInEditor

bool JUtils.ButtonAttribute.clickableInEditor

◆ name

readonly string JUtils.ButtonAttribute.name

The documentation for this class was generated from the following file: