C# Класс UIRect, LoopScorllViewForNGUI

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

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

Свойство Тип Описание
bottomAnchor AnchorPoint,
leftAnchor AnchorPoint,
rightAnchor AnchorPoint,
topAnchor AnchorPoint,
updateAnchors AnchorUpdate

Защищенные свойства (Protected)

Свойство Тип Описание
mChanged bool
mChildren BetterList
mGo GameObject
mParentFound bool
mStarted bool
mTrans Transform
mUpdateAnchors bool

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

Метод Описание
CalculateFinalAlpha ( int frameID ) : float

Get the final cumulative alpha.

FindCameraFor ( AnchorPoint, ap ) : void

Helper function -- attempt to find the camera responsible for the specified anchor.

GetSides ( Transform relativeTo ) : Vector3[]

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

Invalidate ( bool includeChildren ) : void

Sets the local 'changed' flag, indicating that some parent value(s) are now be different, such as alpha for example.

ParentHasChanged ( ) : void

Call this function when the rectangle's parent has changed.

ResetAnchors ( ) : void

Ensure that all rect references are set correctly on the anchors.

ResetAndUpdateAnchors ( ) : void

Convenience method that resets and updates the anchors, all at once.

SetAnchor ( GameObject go ) : void

Anchor this rectangle to the specified transform. Note that this function will not keep the rectangle's current dimensions, but will instead assume the target's dimensions.

SetAnchor ( GameObject go, int left, int bottom, int right, int top ) : void

Anchor this rectangle to the specified transform.

SetAnchor ( Transform t ) : void

Anchor this rectangle to the specified transform. Note that this function will not keep the rectangle's current dimensions, but will instead assume the target's dimensions.

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

Set the rectangle manually.

Update ( ) : void

Rectangles need to update in a specific order -- parents before children. When deriving from this class, override its OnUpdate() function instead.

UpdateAnchors ( ) : void

Manually update anchored sides.

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

Метод Описание
GetLocalPos ( AnchorPoint, ac, Transform trans ) : Vector3

Helper function that gets the specified anchor's position relative to the chosen transform.

OnAnchor ( ) : void

Update the dimensions of the rectangle using anchor points.

OnDisable ( ) : void

Clear the parent rectangle reference.

OnEnable ( ) : void

Automatically find the parent rectangle.

OnInit ( ) : void

Automatically find the parent rectangle.

OnStart ( ) : void

Abstract start functionality, ensured to happen after the anchor rect references have been set.

OnUpdate ( ) : void

Abstract update functionality, ensured to happen after the targeting anchors have been updated.

OnValidate ( ) : void

This callback is sent inside the editor notifying us that some property has changed.

Start ( ) : void

Set anchor rect references on start.

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

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

Get the final cumulative alpha.
public abstract CalculateFinalAlpha ( int frameID ) : float
frameID int
Результат float

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

Helper function -- attempt to find the camera responsible for the specified anchor.
public FindCameraFor ( AnchorPoint, ap ) : void
ap AnchorPoint,
Результат void

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

Helper function that gets the specified anchor's position relative to the chosen transform.
protected GetLocalPos ( AnchorPoint, ac, Transform trans ) : Vector3
ac AnchorPoint,
trans Transform
Результат Vector3

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[]

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

Sets the local 'changed' flag, indicating that some parent value(s) are now be different, such as alpha for example.
public Invalidate ( bool includeChildren ) : void
includeChildren bool
Результат void

OnAnchor() защищенный абстрактный Метод

Update the dimensions of the rectangle using anchor points.
protected abstract OnAnchor ( ) : void
Результат void

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

Clear the parent rectangle reference.
protected OnDisable ( ) : void
Результат void

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

Automatically find the parent rectangle.
protected OnEnable ( ) : void
Результат void

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

Automatically find the parent rectangle.
protected OnInit ( ) : void
Результат void

OnStart() защищенный абстрактный Метод

Abstract start functionality, ensured to happen after the anchor rect references have been set.
protected abstract OnStart ( ) : void
Результат void

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

Abstract update functionality, ensured to happen after the targeting anchors have been updated.
protected OnUpdate ( ) : void
Результат void

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

This callback is sent inside the editor notifying us that some property has changed.
protected OnValidate ( ) : void
Результат void

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

Call this function when the rectangle's parent has changed.
public ParentHasChanged ( ) : void
Результат void

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

Ensure that all rect references are set correctly on the anchors.
public ResetAnchors ( ) : void
Результат void

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

Convenience method that resets and updates the anchors, all at once.
public ResetAndUpdateAnchors ( ) : void
Результат void

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

Anchor this rectangle to the specified transform. Note that this function will not keep the rectangle's current dimensions, but will instead assume the target's dimensions.
public SetAnchor ( GameObject go ) : void
go GameObject
Результат void

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

Anchor this rectangle to the specified transform.
public SetAnchor ( GameObject go, int left, int bottom, int right, int top ) : void
go GameObject
left int
bottom int
right int
top int
Результат void

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

Anchor this rectangle to the specified transform. Note that this function will not keep the rectangle's current dimensions, but will instead assume the target's dimensions.
public SetAnchor ( Transform t ) : void
t Transform
Результат void

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

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

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

Set anchor rect references on start.
protected Start ( ) : void
Результат void

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

Rectangles need to update in a specific order -- parents before children. When deriving from this class, override its OnUpdate() function instead.
public Update ( ) : void
Результат void

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

Manually update anchored sides.
public UpdateAnchors ( ) : void
Результат void

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

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

Bottom side anchor.
public AnchorPoint, bottomAnchor
Результат AnchorPoint,

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

Left side anchor.
public AnchorPoint, leftAnchor
Результат AnchorPoint,

mChanged защищенное свойство

protected bool mChanged
Результат bool

mChildren защищенное свойство

protected BetterList mChildren
Результат BetterList

mGo защищенное свойство

protected GameObject mGo
Результат GameObject

mParentFound защищенное свойство

protected bool mParentFound
Результат bool

mStarted защищенное свойство

protected bool mStarted
Результат bool

mTrans защищенное свойство

protected Transform mTrans
Результат Transform

mUpdateAnchors защищенное свойство

protected bool mUpdateAnchors
Результат bool

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

Right side anchor.
public AnchorPoint, rightAnchor
Результат AnchorPoint,

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

Top side anchor.
public AnchorPoint, topAnchor
Результат AnchorPoint,

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

Whether anchors will be recalculated on every update.
public AnchorUpdate updateAnchors
Результат AnchorUpdate