C# Класс UIPanel, LoopScorllViewForNGUI

Наследование: UIRect
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
alwaysOnScreen bool
anchorOffset bool
cullWhileDragging bool
generateNormals bool
list BetterList
onClipMove OnClippingMoved
onGeometryUpdated OnGeometryUpdated
renderQueue RenderQueue
showInPanelTool bool
startingRenderQueue int
widgetsAreStatic bool

Private Properties

Свойство Тип Описание
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

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
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.

Приватные методы

Метод Описание
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.

Описание методов

AddWidget() публичный Метод

Make the following widget be managed by the panel.
public AddWidget ( UIWidget, w ) : void
w UIWidget,
Результат void

Affects() публичный Метод

Whether the specified widget is going to be affected by this panel in any way.
public Affects ( UIWidget, w ) : bool
w UIWidget,
Результат bool

CalculateConstrainOffset() публичный Метод

Calculate the offset needed to be constrained within the panel's bounds.
public CalculateConstrainOffset ( Vector2 min, Vector2 max ) : Vector3
min Vector2
max Vector2
Результат Vector3

CalculateFinalAlpha() публичный Метод

Widget's final alpha, after taking the panel's alpha into account.
public CalculateFinalAlpha ( int frameID ) : float
frameID int
Результат float

CompareFunc() статический публичный Метод

Function that can be used to depth-sort panels.
static public CompareFunc ( UIPanel, a, UIPanel, b ) : int
a UIPanel,
b UIPanel,
Результат int

ConstrainTargetToBounds() публичный Метод

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
Результат bool

ConstrainTargetToBounds() публичный Метод

Constrain the specified target to be within the panel's bounds.
public ConstrainTargetToBounds ( Transform target, bool immediate ) : bool
target Transform
immediate bool
Результат bool

Find() статический публичный Метод

Find the UIPanel responsible for handling the specified transform.
static public Find ( Transform trans ) : UIPanel,
trans Transform
Результат UIPanel,

Find() статический публичный Метод

Find the UIPanel responsible for handling the specified transform.
static public Find ( Transform trans, bool createIfMissing ) : UIPanel,
trans Transform
createIfMissing bool
Результат UIPanel,

Find() статический публичный Метод

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
Результат UIPanel,

FindDrawCall() публичный Метод

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,
Результат UIDrawCall,

GetSides() публичный Метод

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
Результат Vector3[]

GetViewSize() публичный Метод

Panel's size -- which is either the clipping rect, or the screen dimensions.
public GetViewSize ( ) : Vector2
Результат Vector2

Invalidate() публичный Метод

Invalidating the panel should reset its alpha.
public Invalidate ( bool includeChildren ) : void
includeChildren bool
Результат void

IsVisible() публичный Метод

Returns whether the specified widget is visible by the panel.
public IsVisible ( UIWidget, w ) : bool
w UIWidget,
Результат bool

IsVisible() публичный Метод

Returns whether the specified world position is within the panel's bounds determined by the clipping rect.
public IsVisible ( Vector3 worldPos ) : bool
worldPos Vector3
Результат bool

IsVisible() публичный Метод

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
Результат bool

OnAnchor() защищенный Метод

Update the edges after the anchors have been updated.
protected OnAnchor ( ) : void
Результат void

OnDisable() защищенный Метод

Destroy all draw calls we've created when this script gets disabled.
protected OnDisable ( ) : void
Результат void

OnEnable() защищенный Метод

Reset the frame IDs.
protected OnEnable ( ) : void
Результат void

OnInit() защищенный Метод

Mark all widgets as having been changed so the draw calls get re-created.
protected OnInit ( ) : void
Результат void

OnStart() защищенный Метод

Layer is used to ensure that if it changes, widgets get moved as well.
protected OnStart ( ) : void
Результат void

ParentHasChanged() публичный Метод

Find the parent panel, if we have one.
public ParentHasChanged ( ) : void
Результат void

Refresh() публичный Метод

Immediately refresh the panel.
public Refresh ( ) : void
Результат void

RemoveWidget() публичный Метод

Remove the widget from its current draw call, invalidating everything as needed.
public RemoveWidget ( UIWidget w ) : void
w UIWidget
Результат void

SetDirty() публичный Метод

Invalidate the panel's draw calls, forcing them to be rebuilt on the next update. This call also affects all children.
public SetDirty ( ) : void
Результат void

SetRect() публичный Метод

Set the panel's rectangle.
public SetRect ( float x, float y, float width, float height ) : void
x float
y float
width float
height float
Результат void

SortWidgets() публичный Метод

Immediately sort all child widgets.
public SortWidgets ( ) : void
Результат void

Описание свойств

alwaysOnScreen публичное свойство

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
Результат bool

anchorOffset публичное свойство

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
Результат bool

cullWhileDragging публичное свойство

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
Результат bool

generateNormals публичное свойство

Whether normals and tangents will be generated for all meshes
public bool generateNormals
Результат bool

list статическое публичное свойство

List of active panels.
static public BetterList list
Результат BetterList

onClipMove публичное свойство

Event callback that's triggered when the panel's clip region gets moved.
public OnClippingMoved onClipMove
Результат OnClippingMoved

onGeometryUpdated публичное свойство

Notification triggered when the panel's geometry get rebuilt. It's mainly here for debugging purposes.
public OnGeometryUpdated onGeometryUpdated
Результат OnGeometryUpdated

renderQueue публичное свойство

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
Результат RenderQueue

showInPanelTool публичное свойство

Whether this panel will show up in the panel tool (set this to 'false' for dynamically created temporary panels)
public bool showInPanelTool
Результат bool

startingRenderQueue публичное свойство

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
Результат int

widgetsAreStatic публичное свойство

Whether widgets drawn by this panel are static (won't move). This will improve performance.
public bool widgetsAreStatic
Результат bool