C# Class UIPanel, LoopScorllViewForNGUI

Inheritance: UIRect
Afficher le fichier Open project: tinyantstudio/LoopScorllViewForNGUI Class Usage Examples

Méthodes publiques

Свойство Type Description
alwaysOnScreen bool
anchorOffset bool
cullWhileDragging bool
generateNormals bool
list BetterList
onClipMove OnClippingMoved
onGeometryUpdated OnGeometryUpdated
renderQueue RenderQueue
showInPanelTool bool
startingRenderQueue int
widgetsAreStatic bool

Private Properties

Свойство Type Description
Awake void
FillAllDrawCalls void
FillDrawCall bool
FindParent void
GetWindowSize Vector2
InvalidateClipping void
LateUpdate void
OnDrawGizmos void
RebuildAllDrawCalls void
UpdateDrawCalls void
UpdateLayers void
UpdateSelf void
UpdateTransformMatrix void
UpdateWidgets void

Méthodes publiques

Méthode Description
AddWidget ( UIWidget, w ) : void

Make the following widget be managed by the panel.

Affects ( UIWidget, w ) : bool

Whether the specified widget is going to be affected by this panel in any way.

CalculateConstrainOffset ( Vector2 min, Vector2 max ) : Vector3

Calculate the offset needed to be constrained within the panel's bounds.

CalculateFinalAlpha ( int frameID ) : float

Widget's final alpha, after taking the panel's alpha into account.

CompareFunc ( UIPanel, a, UIPanel, b ) : int

Function that can be used to depth-sort panels.

ConstrainTargetToBounds ( Transform target, Bounds &targetBounds, bool immediate ) : bool

Constrain the current target position to be within panel bounds.

ConstrainTargetToBounds ( Transform target, bool immediate ) : bool

Constrain the specified target to be within the panel's bounds.

Find ( Transform trans ) : UIPanel,

Find the UIPanel responsible for handling the specified transform.

Find ( Transform trans, bool createIfMissing ) : UIPanel,

Find the UIPanel responsible for handling the specified transform.

Find ( Transform trans, bool createIfMissing, int layer ) : UIPanel,

Find the UIPanel responsible for handling the specified transform.

FindDrawCall ( UIWidget, w ) : UIDrawCall,

Insert the specified widget into one of the existing draw calls if possible. If it's not possible, and a new draw call is required, 'null' is returned because draw call creation is a delayed operation.

GetSides ( Transform relativeTo ) : Vector3[]

Get the sides of the rectangle relative to the specified transform. The order is left, top, right, bottom.

GetViewSize ( ) : Vector2

Panel's size -- which is either the clipping rect, or the screen dimensions.

Invalidate ( bool includeChildren ) : void

Invalidating the panel should reset its alpha.

IsVisible ( UIWidget, w ) : bool

Returns whether the specified widget is visible by the panel.

IsVisible ( Vector3 worldPos ) : bool

Returns whether the specified world position is within the panel's bounds determined by the clipping rect.

IsVisible ( Vector3 a, Vector3 b, Vector3 c, Vector3 d ) : bool

Returns whether the specified rectangle is visible by the panel. The coordinates must be in world space.

ParentHasChanged ( ) : void

Find the parent panel, if we have one.

Refresh ( ) : void

Immediately refresh the panel.

RemoveWidget ( UIWidget w ) : void

Remove the widget from its current draw call, invalidating everything as needed.

SetDirty ( ) : void

Invalidate the panel's draw calls, forcing them to be rebuilt on the next update. This call also affects all children.

SetRect ( float x, float y, float width, float height ) : void

Set the panel's rectangle.

SortWidgets ( ) : void

Immediately sort all child widgets.

Méthodes protégées

Méthode Description
OnAnchor ( ) : void

Update the edges after the anchors have been updated.

OnDisable ( ) : void

Destroy all draw calls we've created when this script gets disabled.

OnEnable ( ) : void

Reset the frame IDs.

OnInit ( ) : void

Mark all widgets as having been changed so the draw calls get re-created.

OnStart ( ) : void

Layer is used to ensure that if it changes, widgets get moved as well.

Private Methods

Méthode Description
Awake ( ) : void

Cache components.

FillAllDrawCalls ( ) : void

Fill the geometry fully, processing all widgets and re-creating all draw calls.

FillDrawCall ( UIDrawCall, dc ) : bool

Fill the geometry for the specified draw call.

FindParent ( ) : void

Find the parent panel, if we have one.

GetWindowSize ( ) : Vector2

Get the size of the game window in pixels.

InvalidateClipping ( ) : void

Invalidate the panel's clipping, calling child panels in turn.

LateUpdate ( ) : void

Update all panels and draw calls.

OnDrawGizmos ( ) : void

Draw a visible pink outline for the clipped area.

RebuildAllDrawCalls ( ) : void
UpdateDrawCalls ( ) : void

Update all draw calls associated with the panel.

UpdateLayers ( ) : void

Update the widget layers if the panel's layer has changed.

UpdateSelf ( ) : void

Update the panel, all of its widgets and draw calls.

UpdateTransformMatrix ( ) : void

Update the world-to-local transform matrix as well as clipping bounds.

UpdateWidgets ( ) : void

Update all of the widgets belonging to this panel.

Method Details

AddWidget() public méthode

Make the following widget be managed by the panel.
public AddWidget ( UIWidget, w ) : void
w UIWidget,
Résultat void

Affects() public méthode

Whether the specified widget is going to be affected by this panel in any way.
public Affects ( UIWidget, w ) : bool
w UIWidget,
Résultat bool

CalculateConstrainOffset() public méthode

Calculate the offset needed to be constrained within the panel's bounds.
public CalculateConstrainOffset ( Vector2 min, Vector2 max ) : Vector3
min Vector2
max Vector2
Résultat Vector3

CalculateFinalAlpha() public méthode

Widget's final alpha, after taking the panel's alpha into account.
public CalculateFinalAlpha ( int frameID ) : float
frameID int
Résultat float

CompareFunc() static public méthode

Function that can be used to depth-sort panels.
static public CompareFunc ( UIPanel, a, UIPanel, b ) : int
a UIPanel,
b UIPanel,
Résultat int

ConstrainTargetToBounds() public méthode

Constrain the current target position to be within panel bounds.
public ConstrainTargetToBounds ( Transform target, Bounds &targetBounds, bool immediate ) : bool
target Transform
targetBounds Bounds
immediate bool
Résultat bool

ConstrainTargetToBounds() public méthode

Constrain the specified target to be within the panel's bounds.
public ConstrainTargetToBounds ( Transform target, bool immediate ) : bool
target Transform
immediate bool
Résultat bool

Find() static public méthode

Find the UIPanel responsible for handling the specified transform.
static public Find ( Transform trans ) : UIPanel,
trans Transform
Résultat UIPanel,

Find() static public méthode

Find the UIPanel responsible for handling the specified transform.
static public Find ( Transform trans, bool createIfMissing ) : UIPanel,
trans Transform
createIfMissing bool
Résultat UIPanel,

Find() static public méthode

Find the UIPanel responsible for handling the specified transform.
static public Find ( Transform trans, bool createIfMissing, int layer ) : UIPanel,
trans Transform
createIfMissing bool
layer int
Résultat UIPanel,

FindDrawCall() public méthode

Insert the specified widget into one of the existing draw calls if possible. If it's not possible, and a new draw call is required, 'null' is returned because draw call creation is a delayed operation.
public FindDrawCall ( UIWidget, w ) : UIDrawCall,
w UIWidget,
Résultat UIDrawCall,

GetSides() public méthode

Get the sides of the rectangle relative to the specified transform. The order is left, top, right, bottom.
public GetSides ( Transform relativeTo ) : Vector3[]
relativeTo Transform
Résultat Vector3[]

GetViewSize() public méthode

Panel's size -- which is either the clipping rect, or the screen dimensions.
public GetViewSize ( ) : Vector2
Résultat Vector2

Invalidate() public méthode

Invalidating the panel should reset its alpha.
public Invalidate ( bool includeChildren ) : void
includeChildren bool
Résultat void

IsVisible() public méthode

Returns whether the specified widget is visible by the panel.
public IsVisible ( UIWidget, w ) : bool
w UIWidget,
Résultat bool

IsVisible() public méthode

Returns whether the specified world position is within the panel's bounds determined by the clipping rect.
public IsVisible ( Vector3 worldPos ) : bool
worldPos Vector3
Résultat bool

IsVisible() public méthode

Returns whether the specified rectangle is visible by the panel. The coordinates must be in world space.
public IsVisible ( Vector3 a, Vector3 b, Vector3 c, Vector3 d ) : bool
a Vector3
b Vector3
c Vector3
d Vector3
Résultat bool

OnAnchor() protected méthode

Update the edges after the anchors have been updated.
protected OnAnchor ( ) : void
Résultat void

OnDisable() protected méthode

Destroy all draw calls we've created when this script gets disabled.
protected OnDisable ( ) : void
Résultat void

OnEnable() protected méthode

Reset the frame IDs.
protected OnEnable ( ) : void
Résultat void

OnInit() protected méthode

Mark all widgets as having been changed so the draw calls get re-created.
protected OnInit ( ) : void
Résultat void

OnStart() protected méthode

Layer is used to ensure that if it changes, widgets get moved as well.
protected OnStart ( ) : void
Résultat void

ParentHasChanged() public méthode

Find the parent panel, if we have one.
public ParentHasChanged ( ) : void
Résultat void

Refresh() public méthode

Immediately refresh the panel.
public Refresh ( ) : void
Résultat void

RemoveWidget() public méthode

Remove the widget from its current draw call, invalidating everything as needed.
public RemoveWidget ( UIWidget w ) : void
w UIWidget
Résultat void

SetDirty() public méthode

Invalidate the panel's draw calls, forcing them to be rebuilt on the next update. This call also affects all children.
public SetDirty ( ) : void
Résultat void

SetRect() public méthode

Set the panel's rectangle.
public SetRect ( float x, float y, float width, float height ) : void
x float
y float
width float
height float
Résultat void

SortWidgets() public méthode

Immediately sort all child widgets.
public SortWidgets ( ) : void
Résultat void

Property Details

alwaysOnScreen public_oe property

Optimization flag. Makes the assumption that the panel's geometry will always be on screen and the bounds don't need to be re-calculated.
public bool alwaysOnScreen
Résultat bool

anchorOffset public_oe property

By default, non-clipped panels use the camera's bounds, and the panel's position has no effect. If you want the panel's position to actually be used with anchors, set this field to 'true'.
public bool anchorOffset
Résultat bool

cullWhileDragging public_oe property

Whether widgets will be culled while the panel is being dragged. Having this on improves performance, but turning it off will reduce garbage collection.
public bool cullWhileDragging
Résultat bool

generateNormals public_oe property

Whether normals and tangents will be generated for all meshes
public bool generateNormals
Résultat bool

list static_oe public_oe property

List of active panels.
static public BetterList list
Résultat BetterList

onClipMove public_oe property

Event callback that's triggered when the panel's clip region gets moved.
public OnClippingMoved onClipMove
Résultat OnClippingMoved

onGeometryUpdated public_oe property

Notification triggered when the panel's geometry get rebuilt. It's mainly here for debugging purposes.
public OnGeometryUpdated onGeometryUpdated
Résultat OnGeometryUpdated

renderQueue public_oe property

By default all panels manage render queues of their draw calls themselves by incrementing them so that the geometry is drawn in the proper order. You can alter this behaviour.
public RenderQueue renderQueue
Résultat RenderQueue

showInPanelTool public_oe property

Whether this panel will show up in the panel tool (set this to 'false' for dynamically created temporary panels)
public bool showInPanelTool
Résultat bool

startingRenderQueue public_oe property

Render queue used by the panel. The default value of '3000' is the equivalent of "Transparent". This property is only used if 'renderQueue' is set to something other than "Automatic".
public int startingRenderQueue
Résultat int

widgetsAreStatic public_oe property

Whether widgets drawn by this panel are static (won't move). This will improve performance.
public bool widgetsAreStatic
Résultat bool