Tanoda
Leap.Unity.Attributes.EditorGUIPanelAttribute Class Reference
Inheritance diagram for Leap.Unity.Attributes.EditorGUIPanelAttribute:
Leap.Unity.Attributes.CombinablePropertyAttribute Leap.Unity.Attributes.ITopPanelDrawer

Public Member Functions

 EditorGUIPanelAttribute (string editorMethodName, int heightInLines=1)
 Pass the name of a static method in your MonoBehaviour that accepts a Rect and Object[] targets, which reflects the current editor selection (might be multiple of your MonoBehaviours in a multi-select case). The method is called in an OnGUI inspector context, so you can make EditorGUI or GUI calls. See the example below for example usage. More...
 

Public Attributes

int heightInLines
 
readonly string editorMethodName
 

Static Public Attributes

const float LINE_HEIGHT = 20f
 

Additional Inherited Members

- Properties inherited from Leap.Unity.Attributes.CombinablePropertyAttribute
FieldInfo? fieldInfo [get, protected set]
 
UnityObject[]? targets [get, protected set]
 

Detailed Description

Definition at line 21 of file EditorGUIPanel.cs.

Constructor & Destructor Documentation

◆ EditorGUIPanelAttribute()

Leap.Unity.Attributes.EditorGUIPanelAttribute.EditorGUIPanelAttribute ( string  editorMethodName,
int  heightInLines = 1 
)

Pass the name of a static method in your MonoBehaviour that accepts a Rect and Object[] targets, which reflects the current editor selection (might be multiple of your MonoBehaviours in a multi-select case). The method is called in an OnGUI inspector context, so you can make EditorGUI or GUI calls. See the example below for example usage.

[EditorGUIPanel("DrawPanel")]
public SomeType inspectorObj;
private static void DrawPanel(Rect panel, Object[] targets) {
#if UNITY_EDITOR
if (GUI.Button(panel, "Do Thing")) {
targets.ForEach≤MyBehaviour≥(r => r.DoThing());
}
#endif
}
UnityEngine.Object Object

Definition at line 49 of file EditorGUIPanel.cs.

Member Data Documentation

◆ editorMethodName

readonly string Leap.Unity.Attributes.EditorGUIPanelAttribute.editorMethodName

Definition at line 28 of file EditorGUIPanel.cs.

◆ heightInLines

int Leap.Unity.Attributes.EditorGUIPanelAttribute.heightInLines

Definition at line 27 of file EditorGUIPanel.cs.

◆ LINE_HEIGHT

const float Leap.Unity.Attributes.EditorGUIPanelAttribute.LINE_HEIGHT = 20f
static

Definition at line 25 of file EditorGUIPanel.cs.


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