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
파일 보기 프로젝트 열기: Cedric-Paris/PuzzleGameProject

공개 메소드들

메소드 설명
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