fix bug
parent
ffdb4c9666
commit
3ff95a1796
|
@ -51,7 +51,6 @@ end
|
|||
|
||||
function this:SetDragGO(go)
|
||||
self.dragGO = go
|
||||
self.moveTween = self.dragGO:GetComponent(typeof(UITweenSpring))
|
||||
if not self.moveTween then
|
||||
self.moveTween = self.dragGO:AddComponent(typeof(UITweenSpring))
|
||||
end
|
||||
|
@ -65,7 +64,7 @@ end
|
|||
function this:OnPointerDown(Pointgo, data)
|
||||
if not self.dragGO then return end
|
||||
data:Use()
|
||||
if self.points then
|
||||
if self.points and self.moveTween then
|
||||
if data.pointerEnter == self.trigger.gameObject and #self.points < 2 then
|
||||
table.insert(self.points, data)
|
||||
if #self.points >= 2 then
|
||||
|
@ -89,7 +88,7 @@ end
|
|||
|
||||
function this:OnBeginDrag(Pointgo, data)
|
||||
if not self.dragGO then return end
|
||||
if self.points then
|
||||
if self.points and self.moveTween then
|
||||
if #self.points <= 1 then
|
||||
if self.points[1] == data then
|
||||
self.moveTween.enabled = true
|
||||
|
@ -103,7 +102,7 @@ end
|
|||
|
||||
function this:OnDrag(Pointgo, data)
|
||||
if not self.dragGO then return end
|
||||
if self.points then
|
||||
if self.points and self.moveTween then
|
||||
if self.points[1] == data or self.points[2] == data then
|
||||
if #self.points >= 2 then --双点缩放
|
||||
local distance = Vector2.Distance(self.points[1].position, self.points[2].position)
|
||||
|
@ -123,7 +122,7 @@ end
|
|||
|
||||
function this:OnEndDrag(Pointgo, data)
|
||||
if not self.dragGO then return end
|
||||
if self.points then
|
||||
if self.points and self.moveTween then
|
||||
if #self.points == 0 then --移动增加缓动效果
|
||||
self:SetPosition(data.delta)
|
||||
self.moveTween.IsUseCallBack = true
|
||||
|
|
Loading…
Reference in New Issue