UIDraggableCamera(新增)
/// <summary>
/// Works together with UIDragCamera script, allowing you to drag a secondary camera while keeping it constrained to a certain area.
///和 UIDragCamera脚本一起工作,允许你拖拽一个二级相机同时保持限制到确定区域。
/// </summary>
公共成员函数
/// <summary>
/// Calculate the offset needed to be constrained within the panel's bounds.
/// 计算被限制在面板边界内所需要的偏移值。
/// </summary>
ector3 CalculateConstrainOffset ()
/// <summary>
/// Constrain the current camera's position to be within the viewable area's bounds.
/// 限制当前摄影机的位置在可视区域的边界之内。
/// </summary>
bool ConstrainToBounds (bool immediate)
/// <summary>
/// Calculate the bounds of all widgets under this game object.计算该游戏对象下所有小部件的边界值
/// </summary>
public void Press (bool isPressed)
/// <summary>
/// Drag event receiver.拖拽事件接受器
/// </summary>
public void Drag (Vector2 delta)
/// <summary>
/// If the object should support the scroll wheel, do it.如果对象支持滚轮 Do it.
/// </summary>
public void Scroll (float delta)
公共属性
/// <summary>
/// Root object that will be used for drag-limiting bounds.将用于限制拖拽范围边界 的根对象。
/// </summary>
Transform rootForBounds;
/// <summary>
/// Scale value applied to the drag delta. Set X or Y to 0 to disallow dragging in that direction.
///应用到拖拽增量的缩放值。设置X或Y为0来拒绝在那个方向的拖拽。
/// </summary>
Vector2 scale = Vector2.one;
/// <summary>
/// Effect the scroll wheel will have on the momentum.滚轮在滑动时的动力影响值。
/// </summary>
float scrollWheelFactor = 0f;
/// <summary>
/// Effect to apply when dragging.拖拽时要应用的影响值。
/// </summary>
UIDragObject.DragEffect dragEffect = UIDragObject.DragEffect.MomentumAndSpring;
/// <summary>
/// How much momentum gets applied when the press is released after dragging.
///当拖拽后释放按压时 可以应用的动力是多少。
/// </summary>
float momentumAmount = 35f;
(以下 略)