C# Class UIRect, LoopScorllViewForNGUI

Inheritance: MonoBehaviour
Mostrar archivo Open project: tinyantstudio/LoopScorllViewForNGUI Class Usage Examples

Public Properties

Property Type Description
bottomAnchor AnchorPoint,
leftAnchor AnchorPoint,
rightAnchor AnchorPoint,
topAnchor AnchorPoint,
updateAnchors AnchorUpdate

Protected Properties

Property Type Description
mChanged bool
mChildren BetterList
mGo GameObject
mParentFound bool
mStarted bool
mTrans Transform
mUpdateAnchors bool

Public Methods

Method Description
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.

Protected Methods

Method Description
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.

Method Details

CalculateFinalAlpha() public abstract method

Get the final cumulative alpha.
public abstract CalculateFinalAlpha ( int frameID ) : float
frameID int
return float

FindCameraFor() public method

Helper function -- attempt to find the camera responsible for the specified anchor.
public FindCameraFor ( AnchorPoint, ap ) : void
ap AnchorPoint,
return void

GetLocalPos() protected method

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
return Vector3

GetSides() public method

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

Invalidate() public method

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
return void

OnAnchor() protected abstract method

Update the dimensions of the rectangle using anchor points.
protected abstract OnAnchor ( ) : void
return void

OnDisable() protected method

Clear the parent rectangle reference.
protected OnDisable ( ) : void
return void

OnEnable() protected method

Automatically find the parent rectangle.
protected OnEnable ( ) : void
return void

OnInit() protected method

Automatically find the parent rectangle.
protected OnInit ( ) : void
return void

OnStart() protected abstract method

Abstract start functionality, ensured to happen after the anchor rect references have been set.
protected abstract OnStart ( ) : void
return void

OnUpdate() protected method

Abstract update functionality, ensured to happen after the targeting anchors have been updated.
protected OnUpdate ( ) : void
return void

OnValidate() protected method

This callback is sent inside the editor notifying us that some property has changed.
protected OnValidate ( ) : void
return void

ParentHasChanged() public method

Call this function when the rectangle's parent has changed.
public ParentHasChanged ( ) : void
return void

ResetAnchors() public method

Ensure that all rect references are set correctly on the anchors.
public ResetAnchors ( ) : void
return void

ResetAndUpdateAnchors() public method

Convenience method that resets and updates the anchors, all at once.
public ResetAndUpdateAnchors ( ) : void
return void

SetAnchor() public method

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
return void

SetAnchor() public method

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
return void

SetAnchor() public method

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
return void

SetRect() public abstract method

Set the rectangle manually.
public abstract SetRect ( float x, float y, float width, float height ) : void
x float
y float
width float
height float
return void

Start() protected method

Set anchor rect references on start.
protected Start ( ) : void
return void

Update() public method

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

UpdateAnchors() public method

Manually update anchored sides.
public UpdateAnchors ( ) : void
return void

Property Details

bottomAnchor public_oe property

Bottom side anchor.
public AnchorPoint, bottomAnchor
return AnchorPoint,

leftAnchor public_oe property

Left side anchor.
public AnchorPoint, leftAnchor
return AnchorPoint,

mChanged protected_oe property

protected bool mChanged
return bool

mChildren protected_oe property

protected BetterList mChildren
return BetterList

mGo protected_oe property

protected GameObject mGo
return GameObject

mParentFound protected_oe property

protected bool mParentFound
return bool

mStarted protected_oe property

protected bool mStarted
return bool

mTrans protected_oe property

protected Transform mTrans
return Transform

mUpdateAnchors protected_oe property

protected bool mUpdateAnchors
return bool

rightAnchor public_oe property

Right side anchor.
public AnchorPoint, rightAnchor
return AnchorPoint,

topAnchor public_oe property

Top side anchor.
public AnchorPoint, topAnchor
return AnchorPoint,

updateAnchors public_oe property

Whether anchors will be recalculated on every update.
public AnchorUpdate updateAnchors
return AnchorUpdate