C# Class UIDraggableCamera, Hero.Coli

Inheritance: MonoBehaviour
ファイルを表示 Open project: CyberCRI/Hero.Coli Class Usage Examples

Public Properties

Property Type Description
dragEffect UIDragObject.DragEffect
momentumAmount float
rootForBounds Transform
scale Vector2
scrollWheelFactor float
smoothDragStart bool

Public Methods

Method Description
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.

Private Methods

Method Description
CalculateConstrainOffset ( ) : Vector3

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

Method Details

Awake() public method

Cache the common components.
public Awake ( ) : void
return void

ConstrainToBounds() public method

Constrain the current camera's position to be within the viewable area's bounds.
public ConstrainToBounds ( bool immediate ) : bool
immediate bool
return bool

Drag() public method

Drag event receiver.
public Drag ( Vector2 delta ) : void
delta Vector2
return void

Press() public method

Calculate the bounds of all widgets under this game object.
public Press ( bool isPressed ) : void
isPressed bool
return void

Scroll() public method

If the object should support the scroll wheel, do it.
public Scroll ( float delta ) : void
delta float
return void

Start() public method

Cache the root.
public Start ( ) : void
return void

Update() public method

Apply the dragging momentum.
public Update ( ) : void
return void

Property Details

dragEffect public_oe property

Effect to apply when dragging.
public UIDragObject.DragEffect dragEffect
return UIDragObject.DragEffect

momentumAmount public_oe property

How much momentum gets applied when the press is released after dragging.
public float momentumAmount
return float

rootForBounds public_oe property

Root object that will be used for drag-limiting bounds.
public Transform rootForBounds
return Transform

scale public_oe property

Scale value applied to the drag delta. Set X or Y to 0 to disallow dragging in that direction.
public Vector2 scale
return Vector2

scrollWheelFactor public_oe property

Effect the scroll wheel will have on the momentum.
public float scrollWheelFactor
return float

smoothDragStart public_oe property

Whether the drag operation will be started smoothly, or if if it will be precise (but will have a noticeable "jump").
public bool smoothDragStart
return bool