C# Class MenuButton, PuzzleGameProject

Inheritance: MonoBehaviour
Exibir arquivo Open project: Cedric-Paris/PuzzleGameProject Class Usage Examples

Public Properties

Property Type Description
ElementCount int
OffSprite Sprite
OnSprite Sprite

Public Methods

Method Description
DownElementCount ( ) : void

Sets the element count to elementCount - 1.

OnTriggerEnter2D ( Collider2D other ) : void

Called when this Object's Collider encounters another.

Start ( ) : void

Initializes the MenuButton.

UpElementCount ( ) : void

Sets the element count to elementCount + 1.

Protected Methods

Method Description
GetTextName ( ) : string

Informs which Text is associated with this MenuButton.

GetUIElementToSpawn ( ) : UIDraggableElement,

Informs which UIDraggableElement this MenuButton has to spawn.

IsRightMovementAction ( DraggableElement, draggableElement ) : bool

Informs whether the given Element is the DraggableElement bound the this MenuButton.

Private Methods

Method Description
SetElementCountToText ( ) : void

Sets the element count to the associated Text.

SetOffSprite ( ) : void

Sets the appearance of the MenuButton to OFF.

SetOnSprite ( ) : void

Sets the appearance of the MenuButton to ON.

SpawnUIDraggableElement ( ) : void

Spawns the UIDraggableElement associated with this MenuButton on top of this MenuButton.

Method Details

DownElementCount() public method

Sets the element count to elementCount - 1.
public DownElementCount ( ) : void
return void

GetTextName() protected abstract method

Informs which Text is associated with this MenuButton.
protected abstract GetTextName ( ) : string
return string

GetUIElementToSpawn() protected abstract method

Informs which UIDraggableElement this MenuButton has to spawn.
protected abstract GetUIElementToSpawn ( ) : UIDraggableElement,
return UIDraggableElement,

IsRightMovementAction() protected abstract method

Informs whether the given Element is the DraggableElement bound the this MenuButton.
protected abstract IsRightMovementAction ( DraggableElement, draggableElement ) : bool
draggableElement DraggableElement, The Element to test.
return bool

OnTriggerEnter2D() public method

Called when this Object's Collider encounters another.
public OnTriggerEnter2D ( Collider2D other ) : void
other UnityEngine.Collider2D The that collided with the MenuButton.
return void

Start() public method

Initializes the MenuButton.
public Start ( ) : void
return void

UpElementCount() public method

Sets the element count to elementCount + 1.
public UpElementCount ( ) : void
return void

Property Details

ElementCount public_oe property

The actual element count.
public int ElementCount
return int

OffSprite public_oe property

The Sprite to show when the element count is equal to 0.
public Sprite OffSprite
return Sprite

OnSprite public_oe property

The Sprite to show when the element count is greater than 0.
public Sprite OnSprite
return Sprite