C# Class UIRectEditor, TheUnseen

Inheritance: Editor
Show file Open project: henryj41043/TheUnseen Class Usage Examples

Protected Properties

Property Type Description
FieldName string[]
HorizontalList string[]
IsHorizontal bool[]
PrefixName string[]
VerticalList string[]
mAnchorType AnchorType
mCustom bool[]
mTarget Transform[]

Public Methods

Method Description
OnInspectorGUI ( ) : void

Draw the inspector properties.

UpdateHorizontalAnchor ( UIRect, r, UIRect, anchor, bool resetRelative ) : void

Convenience function that switches the anchor mode and ensures that dimensions are kept intact.

UpdateVerticalAnchor ( UIRect, r, UIRect, anchor, bool resetRelative ) : void

Convenience function that switches the anchor mode and ensures that dimensions are kept intact.

Protected Methods

Method Description
DrawAnchor ( int index, bool targetSelection ) : void

Helper function that draws the suffix after the relative fields.

DrawCustomProperties ( ) : void
DrawFinalProperties ( ) : void

Draw the "Anchors" property block.

DrawSingleAnchorSelection ( ) : UnityEditor.SerializedProperty

Draw a selection for a single target (one target sets all 4 sides)

GetCamera ( UnityEditor.SerializedProperty sp ) : Camera

Pass something like leftAnchor.target to get its rectangle reference.

GetRect ( UnityEditor.SerializedProperty sp ) : UIRect,

Pass something like leftAnchor.target to get its rectangle reference.

IsCommon ( float relative ) : bool

Whether the specified relative offset is a common value (0, 0.5, or 1)

IsRect ( UnityEditor.SerializedProperty sp ) : bool

Returns 'true' if the specified serialized property reference is a UIRect.

OnDrawFinalProperties ( ) : void
OnEnable ( ) : void

Determine the initial anchor type.

ReEvaluateAnchorType ( ) : void

Manually re-evaluate the current anchor type.

ShouldDrawProperties ( ) : bool
UpdateAnchor ( int index, bool resetRelative ) : void

Convenience function that switches the anchor mode and ensures that dimensions are kept intact.

UpdateAnchors ( bool resetRelative ) : void

Convenience function that switches the anchor mode and ensures that dimensions are kept intact.

Method Details

DrawAnchor() protected method

Helper function that draws the suffix after the relative fields.
protected DrawAnchor ( int index, bool targetSelection ) : void
index int
targetSelection bool
return void

DrawCustomProperties() protected method

protected DrawCustomProperties ( ) : void
return void

DrawFinalProperties() protected method

Draw the "Anchors" property block.
protected DrawFinalProperties ( ) : void
return void

DrawSingleAnchorSelection() protected method

Draw a selection for a single target (one target sets all 4 sides)
protected DrawSingleAnchorSelection ( ) : UnityEditor.SerializedProperty
return UnityEditor.SerializedProperty

GetCamera() static protected method

Pass something like leftAnchor.target to get its rectangle reference.
static protected GetCamera ( UnityEditor.SerializedProperty sp ) : Camera
sp UnityEditor.SerializedProperty
return Camera

GetRect() static protected method

Pass something like leftAnchor.target to get its rectangle reference.
static protected GetRect ( UnityEditor.SerializedProperty sp ) : UIRect,
sp UnityEditor.SerializedProperty
return UIRect,

IsCommon() static protected method

Whether the specified relative offset is a common value (0, 0.5, or 1)
static protected IsCommon ( float relative ) : bool
relative float
return bool

IsRect() static protected method

Returns 'true' if the specified serialized property reference is a UIRect.
static protected IsRect ( UnityEditor.SerializedProperty sp ) : bool
sp UnityEditor.SerializedProperty
return bool

OnDrawFinalProperties() protected method

protected OnDrawFinalProperties ( ) : void
return void

OnEnable() protected method

Determine the initial anchor type.
protected OnEnable ( ) : void
return void

OnInspectorGUI() public method

Draw the inspector properties.
public OnInspectorGUI ( ) : void
return void

ReEvaluateAnchorType() protected method

Manually re-evaluate the current anchor type.
protected ReEvaluateAnchorType ( ) : void
return void

ShouldDrawProperties() protected method

protected ShouldDrawProperties ( ) : bool
return bool

UpdateAnchor() protected method

Convenience function that switches the anchor mode and ensures that dimensions are kept intact.
protected UpdateAnchor ( int index, bool resetRelative ) : void
index int
resetRelative bool
return void

UpdateAnchors() protected method

Convenience function that switches the anchor mode and ensures that dimensions are kept intact.
protected UpdateAnchors ( bool resetRelative ) : void
resetRelative bool
return void

UpdateHorizontalAnchor() static public method

Convenience function that switches the anchor mode and ensures that dimensions are kept intact.
static public UpdateHorizontalAnchor ( UIRect, r, UIRect, anchor, bool resetRelative ) : void
r UIRect,
anchor UIRect,
resetRelative bool
return void

UpdateVerticalAnchor() static public method

Convenience function that switches the anchor mode and ensures that dimensions are kept intact.
static public UpdateVerticalAnchor ( UIRect, r, UIRect, anchor, bool resetRelative ) : void
r UIRect,
anchor UIRect,
resetRelative bool
return void

Property Details

FieldName static protected property

static protected string[] FieldName
return string[]

HorizontalList static protected property

static protected string[] HorizontalList
return string[]

IsHorizontal static protected property

static protected bool[] IsHorizontal
return bool[]

PrefixName static protected property

static protected string[] PrefixName
return string[]

VerticalList static protected property

static protected string[] VerticalList
return string[]

mAnchorType protected property

protected AnchorType mAnchorType
return AnchorType

mCustom protected property

protected bool[] mCustom
return bool[]

mTarget protected property

protected Transform[] mTarget
return Transform[]