C# Class AutoSpriteControlBase, urban-survivors

Serves as the base for all AutoSprite-based controls. The main purpose of having this is so we can deal with all control types as a group, such as using a custom inspector.
Inheritance: AutoSpriteBase, IControl, IUIObject, IPackableControl
ファイルを表示 Open project: exdev/urban-survivors Class Usage Examples

Public Properties

Property Type Description
includeTextInAutoCollider bool
spriteText SpriteText,
text string
textOffsetZ float

Protected Properties

Property Type Description
aggregateLayers SpriteRoot[][],
bottomRightEdge Vector2
changeDelegate EZValueChangedDelegate
container IUIContainer
customCollider bool
defaultTextAlignment SpriteText.Alignment_Type
defaultTextAnchor SpriteText.Anchor_Pos
inputDelegate EZInputDelegate
m_controlIsEnabled bool
nullCamera bool
savedColliderSize Vector3
topLeftEdge Vector2

Public Methods

Method Description
AddInputDelegate ( EZInputDelegate del ) : void
AddValueChangedDelegate ( EZValueChangedDelegate del ) : void
Copy ( IControl c ) : void
Copy ( IControl c, ControlCopyFlags flags ) : void
Copy ( SpriteRoot, s ) : void

Copies all of the specified control's settings to this control, provided they are of the same type. One exception is that layers are not copied as this would require a new allocation and could negatively impact performance at runtime.

Copy ( SpriteRoot, s, ControlCopyFlags flags ) : void

Copies all of the specified control's settings to this control, provided they are of the same type. One exception is that layers are not copied as this would require a new allocation and could negatively impact performance at runtime.

DrawPostStateSelectGUI ( int selState ) : int
DrawPreStateSelectGUI ( int selState, bool inspector ) : int
DrawPreTransitionUI ( int selState, IGUIScriptSelector gui ) : void
EnumStateElements ( ) : string[]
FindOuterEdges ( ) : void
GetStateElementInfo ( int stateNum ) : ASCSEInfo,
GetStateLabel ( int index ) : string

Gets/sets the array of strings that correspond to each control state.

GetTransitions ( int index ) : EZTransitionList
GotFocus ( ) : bool
Hide ( bool tf ) : void
OnDrawGizmos ( ) : void
OnInput ( POINTER_INFO, ptr ) : void
RemoveInputDelegate ( EZInputDelegate del ) : void
RemoveValueChangedDelegate ( EZValueChangedDelegate del ) : void
RequestContainership ( IUIContainer cont ) : bool
SetCamera ( Camera c ) : void
SetInputDelegate ( EZInputDelegate del ) : void
SetStateLabel ( int index, string label ) : void

Sets the string for the specified state label.

SetValueChangedDelegate ( EZValueChangedDelegate del ) : void
Start ( ) : void
TruncateBottom ( float pct ) : void
TruncateLeft ( float pct ) : void
TruncateRight ( float pct ) : void
TruncateTop ( float pct ) : void
Unclip ( ) : void
Untruncate ( ) : void
UpdateCollider ( ) : void

Updates the collider of the control so that it encompasses the extents of the control's content. NOTE: To include the control's associated text in the calculation, be sure to check the includeTextInAutoCollider box.

Protected Methods

Method Description
AddCollider ( ) : void
Awake ( ) : void
Init ( ) : void
OnDisable ( ) : void
OnEnable ( ) : void
OnResize ( float newWidth, float newHeight, SpriteRoot, sprite ) : void
UseStateLabel ( int index ) : void

Method Details

AddCollider() protected method

protected AddCollider ( ) : void
return void

AddInputDelegate() public method

public AddInputDelegate ( EZInputDelegate del ) : void
del EZInputDelegate
return void

AddValueChangedDelegate() public method

public AddValueChangedDelegate ( EZValueChangedDelegate del ) : void
del EZValueChangedDelegate
return void

Awake() protected method

protected Awake ( ) : void
return void

Copy() public method

public Copy ( IControl c ) : void
c IControl
return void

Copy() public method

public Copy ( IControl c, ControlCopyFlags flags ) : void
c IControl
flags ControlCopyFlags
return void

Copy() public method

Copies all of the specified control's settings to this control, provided they are of the same type. One exception is that layers are not copied as this would require a new allocation and could negatively impact performance at runtime.
public Copy ( SpriteRoot, s ) : void
s SpriteRoot, Reference to the control whose settings are to be copied to this control.
return void

Copy() public method

Copies all of the specified control's settings to this control, provided they are of the same type. One exception is that layers are not copied as this would require a new allocation and could negatively impact performance at runtime.
public Copy ( SpriteRoot, s, ControlCopyFlags flags ) : void
s SpriteRoot, Reference to the control whose settings are to be copied to this control.
flags ControlCopyFlags
return void

DrawPostStateSelectGUI() public method

public DrawPostStateSelectGUI ( int selState ) : int
selState int
return int

DrawPreStateSelectGUI() public method

public DrawPreStateSelectGUI ( int selState, bool inspector ) : int
selState int
inspector bool
return int

DrawPreTransitionUI() public method

public DrawPreTransitionUI ( int selState, IGUIScriptSelector gui ) : void
selState int
gui IGUIScriptSelector
return void

EnumStateElements() public method

public EnumStateElements ( ) : string[]
return string[]

FindOuterEdges() public method

public FindOuterEdges ( ) : void
return void

GetStateElementInfo() public method

public GetStateElementInfo ( int stateNum ) : ASCSEInfo,
stateNum int
return ASCSEInfo,

GetStateLabel() public method

Gets/sets the array of strings that correspond to each control state.
public GetStateLabel ( int index ) : string
index int
return string

GetTransitions() public method

public GetTransitions ( int index ) : EZTransitionList
index int
return EZTransitionList

GotFocus() public method

public GotFocus ( ) : bool
return bool

Hide() public method

public Hide ( bool tf ) : void
tf bool
return void

Init() protected method

protected Init ( ) : void
return void

OnDisable() protected method

protected OnDisable ( ) : void
return void

OnDrawGizmos() public method

public OnDrawGizmos ( ) : void
return void

OnEnable() protected method

protected OnEnable ( ) : void
return void

OnInput() public method

public OnInput ( POINTER_INFO, ptr ) : void
ptr POINTER_INFO,
return void

OnResize() protected method

protected OnResize ( float newWidth, float newHeight, SpriteRoot, sprite ) : void
newWidth float
newHeight float
sprite SpriteRoot,
return void

RemoveInputDelegate() public method

public RemoveInputDelegate ( EZInputDelegate del ) : void
del EZInputDelegate
return void

RemoveValueChangedDelegate() public method

public RemoveValueChangedDelegate ( EZValueChangedDelegate del ) : void
del EZValueChangedDelegate
return void

RequestContainership() public method

public RequestContainership ( IUIContainer cont ) : bool
cont IUIContainer
return bool

SetCamera() public method

public SetCamera ( Camera c ) : void
c Camera
return void

SetInputDelegate() public method

public SetInputDelegate ( EZInputDelegate del ) : void
del EZInputDelegate
return void

SetStateLabel() public method

Sets the string for the specified state label.
public SetStateLabel ( int index, string label ) : void
index int index of the state to set.
label string The string to set as the state's label.
return void

SetValueChangedDelegate() public method

public SetValueChangedDelegate ( EZValueChangedDelegate del ) : void
del EZValueChangedDelegate
return void

Start() public method

public Start ( ) : void
return void

TruncateBottom() public method

public TruncateBottom ( float pct ) : void
pct float
return void

TruncateLeft() public method

public TruncateLeft ( float pct ) : void
pct float
return void

TruncateRight() public method

public TruncateRight ( float pct ) : void
pct float
return void

TruncateTop() public method

public TruncateTop ( float pct ) : void
pct float
return void

Unclip() public method

public Unclip ( ) : void
return void

Untruncate() public method

public Untruncate ( ) : void
return void

UpdateCollider() public method

Updates the collider of the control so that it encompasses the extents of the control's content. NOTE: To include the control's associated text in the calculation, be sure to check the includeTextInAutoCollider box.
public UpdateCollider ( ) : void
return void

UseStateLabel() protected method

protected UseStateLabel ( int index ) : void
index int
return void

Property Details

aggregateLayers protected_oe property

protected SpriteRoot[][], aggregateLayers
return SpriteRoot[][],

bottomRightEdge protected_oe property

protected Vector2 bottomRightEdge
return Vector2

changeDelegate protected_oe property

protected EZValueChangedDelegate changeDelegate
return EZValueChangedDelegate

container protected_oe property

protected IUIContainer container
return IUIContainer

customCollider protected_oe property

protected bool customCollider
return bool

defaultTextAlignment protected_oe property

protected SpriteText.Alignment_Type defaultTextAlignment
return SpriteText.Alignment_Type

defaultTextAnchor protected_oe property

protected SpriteText.Anchor_Pos defaultTextAnchor
return SpriteText.Anchor_Pos

includeTextInAutoCollider public_oe property

When true, of a collider is generated for the control, the associated text is taken into account when calculating the extents of the collider.
public bool includeTextInAutoCollider
return bool

inputDelegate protected_oe property

protected EZInputDelegate inputDelegate
return EZInputDelegate

m_controlIsEnabled protected_oe property

protected bool m_controlIsEnabled
return bool

nullCamera protected_oe property

protected bool nullCamera
return bool

savedColliderSize protected_oe property

protected Vector3 savedColliderSize
return Vector3

spriteText public_oe property

Reference to optional SpriteText which will display this item's text. It is STRONGLY recommended that this mesh exist on a GameObject that is a child of the list item itself.
public SpriteText, spriteText
return SpriteText,

text public_oe property

Text to be displayed on the control. Do not set this directly in-code. Instead, use the "Text" property or else your changes will not take effect.
public string text
return string

textOffsetZ public_oe property

When text is generated by the control at runtime, it will, by default, have its offsetZ setting set to this value. NOTE: Negative values will result in text being in front of the control. Positive values will place the text behind the control.
public float textOffsetZ
return float

topLeftEdge protected_oe property

protected Vector2 topLeftEdge
return Vector2