C# Класс UIDraggableCamera, Hero.Coli

Наследование: MonoBehaviour
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
dragEffect UIDragObject.DragEffect
momentumAmount float
rootForBounds Transform
scale Vector2
scrollWheelFactor float
smoothDragStart bool

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

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

Cache the common components.

ConstrainToBounds ( bool immediate ) : bool

Constrain the current camera's position to be within the viewable area's bounds.

Drag ( Vector2 delta ) : void

Drag event receiver.

Press ( bool isPressed ) : void

Calculate the bounds of all widgets under this game object.

Scroll ( float delta ) : void

If the object should support the scroll wheel, do it.

Start ( ) : void

Cache the root.

Update ( ) : void

Apply the dragging momentum.

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

Метод Описание
CalculateConstrainOffset ( ) : Vector3

Calculate the offset needed to be constrained within the panel's bounds.

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

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

Cache the common components.
public Awake ( ) : void
Результат void

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

Constrain the current camera's position to be within the viewable area's bounds.
public ConstrainToBounds ( bool immediate ) : bool
immediate bool
Результат bool

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

Drag event receiver.
public Drag ( Vector2 delta ) : void
delta Vector2
Результат void

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

Calculate the bounds of all widgets under this game object.
public Press ( bool isPressed ) : void
isPressed bool
Результат void

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

If the object should support the scroll wheel, do it.
public Scroll ( float delta ) : void
delta float
Результат void

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

Cache the root.
public Start ( ) : void
Результат void

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

Apply the dragging momentum.
public Update ( ) : void
Результат void

Описание свойств

dragEffect публичное свойство

Effect to apply when dragging.
public UIDragObject.DragEffect dragEffect
Результат UIDragObject.DragEffect

momentumAmount публичное свойство

How much momentum gets applied when the press is released after dragging.
public float momentumAmount
Результат float

rootForBounds публичное свойство

Root object that will be used for drag-limiting bounds.
public Transform rootForBounds
Результат Transform

scale публичное свойство

Scale value applied to the drag delta. Set X or Y to 0 to disallow dragging in that direction.
public Vector2 scale
Результат Vector2

scrollWheelFactor публичное свойство

Effect the scroll wheel will have on the momentum.
public float scrollWheelFactor
Результат float

smoothDragStart публичное свойство

Whether the drag operation will be started smoothly, or if if it will be precise (but will have a noticeable "jump").
public bool smoothDragStart
Результат bool