NGUI v2.0 Interaction_14:UIDraggableCamera UI可拖拽摄像机类

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;

 

 

 

                            (以下   略)


http://blog.csdn.net/ldghd/article/details/7829433

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值