Class PanelView
Common base class for gui drawn in panels and window tear off.
Namespace: UnityEditor.MARS
Syntax
public abstract class PanelView : ScriptableObject
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
Does the panel popout support scrolling
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
Does the panel scroll horizontally
Declaration
public bool ScrollingHorizontal { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
ScrollingVertical
Does the panel scroll Vertically
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 |
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()
This function is called when the scriptable object goes out of scope.
Declaration
public virtual void OnDisable()
OnEnable()
This function is called when the object is loaded.
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()