C# Class UIWidget, DsynBio

Base class for all UI components that should be derived from when creating new widget types.
Inheritance: MonoBehaviour
Datei anzeigen Open project: CyberCRI/DsynBio Class Usage Examples

Protected Properties

Property Type Description
mChanged bool
mPanel UIPanel
mPlayMode bool
mTrans Transform

Public Methods

Method Description
CheckLayer ( ) : void

Check to ensure that the widget resides on the same layer as its panel.

CompareFunc ( UIWidget, left, UIWidget, right ) : int

Static widget comparison function used for Z-sorting.

CreatePanel ( ) : void

Ensure we have a panel referencing this widget.

MakePixelPerfect ( ) : void

Make the widget pixel-perfect.

MarkAsChanged ( ) : void

Tell the panel responsible for the widget that something has changed and the buffers need to be rebuilt.

MarkAsChangedLite ( ) : void

Only sets the local flag, does not notify the panel. In most cases you will want to use MarkAsChanged() instead.

OnFill ( BetterList verts, BetterList uvs, BetterList cols ) : void

Virtual function called by the UIPanel that fills the buffers.

OnUpdate ( ) : bool

Virtual version of the Update function. Should return 'true' if the widget has changed visually.

ParentHasChanged ( ) : void

Checks to ensure that the widget is still parented to the right panel.

Update ( ) : void

Ensure that we have a panel to work with. The reason the panel isn't added in OnEnable() is because OnEnable() is called right after Awake(), which is a problem when the widget is brought in on a prefab object as it happens before it gets parented.

UpdateGeometry ( Matrix4x4 &worldToPanel, bool parentMoved, bool generateNormals ) : bool

Update the widget and fill its geometry if necessary. Returns whether something was changed.

WriteToBuffers ( BetterList v, BetterList u, BetterList c, BetterList n, BetterList t ) : void

Append the local geometry buffers to the specified ones.

Protected Methods

Method Description
Awake ( ) : void

Remember whether we're in play mode.

OnDestroy ( ) : void

Unregister this widget.

OnDisable ( ) : void

Clear references.

OnDrawGizmos ( ) : void

Draw some selectable gizmos.

OnEnable ( ) : void

Mark the widget and the panel as having been changed.

OnStart ( ) : void

Virtual Start() functionality for widgets.

Start ( ) : void

Set the depth, call the virtual start function, and sure we have a panel to work with.

Private Methods

Method Description
CheckParent ( ) : void

Method Details

Awake() protected method

Remember whether we're in play mode.
protected Awake ( ) : void
return void

CheckLayer() public method

Check to ensure that the widget resides on the same layer as its panel.
public CheckLayer ( ) : void
return void

CompareFunc() public static method

Static widget comparison function used for Z-sorting.
public static CompareFunc ( UIWidget, left, UIWidget, right ) : int
left UIWidget,
right UIWidget,
return int

CreatePanel() public method

Ensure we have a panel referencing this widget.
public CreatePanel ( ) : void
return void

MakePixelPerfect() public method

Make the widget pixel-perfect.
public MakePixelPerfect ( ) : void
return void

MarkAsChanged() public method

Tell the panel responsible for the widget that something has changed and the buffers need to be rebuilt.
public MarkAsChanged ( ) : void
return void

MarkAsChangedLite() public method

Only sets the local flag, does not notify the panel. In most cases you will want to use MarkAsChanged() instead.
public MarkAsChangedLite ( ) : void
return void

OnDestroy() protected method

Unregister this widget.
protected OnDestroy ( ) : void
return void

OnDisable() protected method

Clear references.
protected OnDisable ( ) : void
return void

OnDrawGizmos() protected method

Draw some selectable gizmos.
protected OnDrawGizmos ( ) : void
return void

OnEnable() protected method

Mark the widget and the panel as having been changed.
protected OnEnable ( ) : void
return void

OnFill() public method

Virtual function called by the UIPanel that fills the buffers.
public OnFill ( BetterList verts, BetterList uvs, BetterList cols ) : void
verts BetterList
uvs BetterList
cols BetterList
return void

OnStart() protected method

Virtual Start() functionality for widgets.
protected OnStart ( ) : void
return void

OnUpdate() public method

Virtual version of the Update function. Should return 'true' if the widget has changed visually.
public OnUpdate ( ) : bool
return bool

ParentHasChanged() public method

Checks to ensure that the widget is still parented to the right panel.
public ParentHasChanged ( ) : void
return void

Start() protected method

Set the depth, call the virtual start function, and sure we have a panel to work with.
protected Start ( ) : void
return void

Update() public method

Ensure that we have a panel to work with. The reason the panel isn't added in OnEnable() is because OnEnable() is called right after Awake(), which is a problem when the widget is brought in on a prefab object as it happens before it gets parented.
public Update ( ) : void
return void

UpdateGeometry() public method

Update the widget and fill its geometry if necessary. Returns whether something was changed.
public UpdateGeometry ( Matrix4x4 &worldToPanel, bool parentMoved, bool generateNormals ) : bool
worldToPanel Matrix4x4
parentMoved bool
generateNormals bool
return bool

WriteToBuffers() public method

Append the local geometry buffers to the specified ones.
public WriteToBuffers ( BetterList v, BetterList u, BetterList c, BetterList n, BetterList t ) : void
v BetterList
u BetterList
c BetterList
n BetterList
t BetterList
return void

Property Details

mChanged protected_oe property

protected bool mChanged
return bool

mPanel protected_oe property

protected UIPanel mPanel
return UIPanel

mPlayMode protected_oe property

protected bool mPlayMode
return bool

mTrans protected_oe property

protected Transform mTrans
return Transform