Class PanelView
Common base class for gui drawn in panels and window tear off.
Namespace: Unity.MARS
Syntax
[Serializable]
public abstract class PanelView : ScriptableObject
Fields
RecordFoldoutAnalyticsEvent
Action called when panel expanded has changed.
Declaration
public Action<bool> RecordFoldoutAnalyticsEvent
Field Value
Type | Description |
---|---|
Action<Boolean> |
Properties
AutoRepaintOnSceneChange
Should the panel cause the tear off window to auto repaint on scene change
Declaration
public abstract bool AutoRepaintOnSceneChange { get; }
Property Value
Type | Description |
---|---|
Boolean |
DrawAsWindow
Is the panel being drawn in a tear off window.
Declaration
public abstract bool DrawAsWindow { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
EditorWindow
Tear off editor window the panel is attached to.
Declaration
public virtual EditorWindow EditorWindow { get; set; }
Property Value
Type | Description |
---|---|
EditorWindow |
HelpButtonAction
Callback for help button Action.
Declaration
public virtual Action HelpButtonAction { get; }
Property Value
Type | Description |
---|---|
Action |
MaxSize
Maximum sized of the panel
Declaration
public abstract Vector2 MaxSize { get; }
Property Value
Type | Description |
---|---|
Vector2 |
MinSize
Minimum size of the panel
Declaration
public abstract Vector2 MinSize { get; }
Property Value
Type | Description |
---|---|
Vector2 |
PanelExpanded
Is the panel currently expanded under the header.
Declaration
public virtual bool PanelExpanded { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
PanelLabel
Name of the panel used in the header and for tear off window name.
Declaration
public abstract string PanelLabel { get; }
Property Value
Type | Description |
---|---|
String |
PanelPopoutCanScroll
Declaration
public virtual bool PanelPopoutCanScroll { get; }
Property Value
Type | Description |
---|---|
Boolean |
PanelWindow
Panel window the panel is attached to.
Declaration
public virtual EditorWindow PanelWindow { get; set; }
Property Value
Type | Description |
---|---|
EditorWindow |
PreferredSize
Size of panel when opening as a window
Declaration
public abstract Vector2 PreferredSize { get; }
Property Value
Type | Description |
---|---|
Vector2 |
ScrollingHorizontal
Declaration
public bool ScrollingHorizontal { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
ScrollingVertical
Declaration
public bool ScrollingVertical { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
SettingsButtonFunc
Callback for popup settings panel view.
Declaration
public virtual Func<GenericMenu> SettingsButtonFunc { get; }
Property Value
Type | Description |
---|---|
Func<GenericMenu> |
TabMenuFunc
Callback for Tab panel view. Override with Null if you want not drawn.
Declaration
public virtual Func<GenericMenu> TabMenuFunc { get; }
Property Value
Type | Description |
---|---|
Func<GenericMenu> |
UsePrefSize
Should the panel use the preferred size when initially drawing as a window.
Declaration
public abstract bool UsePrefSize { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
AddItemsToTabMenu(GenericMenu)
Draws the basic panel tab options. Override to add more Options to the menu popup.
Declaration
public virtual GenericMenu AddItemsToTabMenu(GenericMenu menu)
Parameters
Type | Name | Description |
---|---|---|
GenericMenu | menu |
Returns
Type | Description |
---|---|
GenericMenu | generic menu with options for active panel |
MenuItems()
Used to add extra menu items to the panel view's create panel menu.
Declaration
protected virtual PanelView.MenuItemData[] MenuItems()
Returns
Type | Description |
---|---|
PanelView.MenuItemData[] | The menu items to be added to the generic menu |
OnDisable()
Declaration
public virtual void OnDisable()
OnEnable()
Declaration
public virtual void OnEnable()
OnGUI()
Draws the panel contents
Declaration
public virtual void OnGUI()
OnSelectionChanged()
Callback for on selection change.
Declaration
public abstract void OnSelectionChanged()
Repaint()
Calls repaint on the panel and the parent window(s).
Declaration
public abstract void Repaint()