Summary
[Editor-Only] Utility for implementing IMGUI controls.
- Assembly
- Animancer
.dll - Namespace
- Animancer
.Editor - Base Types
-
- ValueType
graph BT
Type-->Base0["ValueType"]
Type["GUIControl"]
class Type type-node
Syntax
public readonly struct GUIControl : ValueType
Remarks
Example:
private static readonly int ControlHash = "ControlName".GetHashCode();
void OnGUI(Rect area)
{
var control = new GUIControl(area, ControlHash);
switch (control.EventType)
{
case EventType.MouseDown:
if (control.TryUseMouseDown())
{
}
break;
case EventType.MouseUp:
if (control.TryUseMouseUp())
{
}
break;
case EventType.MouseDrag:
if (control.TryUseHotControl())
{
}
break;
}
}
Constructors
Name | Summary |
---|---|
GUIControl |
Creaates a new Animancer.Editor.GUIControl . |
GUIControl |
Creaates a new Animancer.Editor.GUIControl with the UnityEngine.Event.current . |
Fields
Properties
Name | Value | Summary |
---|---|---|
Contains |
bool |
Does the
Animancer.Editor.GUIControl.Area contain the UnityEngine.Event.mousePosition ? |
EventType | EventType |
The type of the
Animancer.Editor.GUIControl.Event in relation to this control. |
Methods
Name | Value | Summary |
---|---|---|
TryUseHotControl |
bool |
Animancer.Editor.AnimancerGUI.TryUseHotControl(UnityEngine.Event,System.Int32,System.Boolean) |
TryUseKey |
bool |
Animancer.Editor.AnimancerGUI.TryUseKey(UnityEngine.Event,System.Int32,UnityEngine.KeyCode) |
TryUseMouseDown |
bool |
Animancer.Editor.AnimancerGUI.TryUseMouseDown(UnityEngine.Rect,UnityEngine.Event,System.Int32) |
TryUseMouseUp |
bool |
Animancer.Editor.AnimancerGUI.TryUseMouseUp(UnityEngine.Event,System.Int32,System.Boolean) |