C# Класс UIDraggableElement, PuzzleGameProject

The UIDraggableElement is the element the MenuButton will spawn. This element is spawned so that there is always one and only one UIDraggableElement on top of the MenuButton when the button's count is greater than 0. This UIDraggableElement is Draggable so the player can move it around with its finger to the Square on the map he wants the corresponding Element to spawn.
Наследование: MonoBehaviour, Draggable
Показать файл Открыть проект

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

Метод Описание
OnMouseDown ( ) : void

Implemented from the Draggable interface. If the object has a Collider, a touch or a click will drag the object. This method is called when the object is picked up by the mouse or finger. Here, we tell the associated MenuButton this UIDraggableElement was taken.

OnMouseDrag ( ) : void

Implemented from the Draggable interface. If the object has a Collider, a touch or a click will drag the object. Here, we make the UIDraggableElement follow the mouse's cursor.

OnMouseDrop ( ) : void

Implemented from the Draggable interface. If the object has a Collider, a touch or a click will drag the object. This method is called when the object is dropped by the mouse or finger. Here, we spawn the Element associated with this UIDraggableElement at the right position and destroy this object.

OnMouseUp ( ) : void

Implemented from the Draggable interface. If the object has a Collider, a touch or a click will drag the object. This method is called when the object is dropped by the mouse or finger. Here, we move the UIDraggableElement to its last position.

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

Метод Описание
GetAssociatedMenuButtonName ( ) : string

Informs which button is associated with this UIDraggableElement.

GetElementBase ( ) : DraggableElement,

Informs which Element this UIDraggableElement has to spawn.

Приватные методы

Метод Описание
CalculDemiLePlusProche ( float value ) : float

Calculates the nearest n.5 float.

Resize ( GameObject canvas ) : void

Resizes the UIDraggableElement so it matches the size of the correponding MenuButton.

Start ( ) : void

Initializes the UIDraggableElement.

UndoMoveUIDraggableElement ( ) : void

Returns the UIDraggableElement to its original place.

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

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

Informs which button is associated with this UIDraggableElement.
protected abstract GetAssociatedMenuButtonName ( ) : string
Результат string

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

Informs which Element this UIDraggableElement has to spawn.
protected abstract GetElementBase ( ) : DraggableElement,
Результат DraggableElement,

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

Implemented from the Draggable interface. If the object has a Collider, a touch or a click will drag the object. This method is called when the object is picked up by the mouse or finger. Here, we tell the associated MenuButton this UIDraggableElement was taken.
public OnMouseDown ( ) : void
Результат void

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

Implemented from the Draggable interface. If the object has a Collider, a touch or a click will drag the object. Here, we make the UIDraggableElement follow the mouse's cursor.
public OnMouseDrag ( ) : void
Результат void

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

Implemented from the Draggable interface. If the object has a Collider, a touch or a click will drag the object. This method is called when the object is dropped by the mouse or finger. Here, we spawn the Element associated with this UIDraggableElement at the right position and destroy this object.
public OnMouseDrop ( ) : void
Результат void

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

Implemented from the Draggable interface. If the object has a Collider, a touch or a click will drag the object. This method is called when the object is dropped by the mouse or finger. Here, we move the UIDraggableElement to its last position.
public OnMouseUp ( ) : void
Результат void