【金钱组件】添加旋转接口
parent
601e1c0971
commit
645fc52869
|
|
@ -204,6 +204,13 @@ function MoneyNumView:SetOffsetPosition(position)
|
|||
self:RefreshOffsetPosition()
|
||||
end
|
||||
|
||||
function MoneyNumView:SetOffsetRotation(rotation)
|
||||
if not rotation then
|
||||
return
|
||||
end
|
||||
self.offsetRotation = rotation
|
||||
self:RefreshOffsetRotation()
|
||||
end
|
||||
--
|
||||
-- function MoneyNumView:Update()
|
||||
-- -- 延迟3帧刷新大小
|
||||
|
|
@ -225,10 +232,10 @@ function MoneyNumView:RefreshSize()
|
|||
self.transform.sizeDelta = self.Image_Num_Horizontal.transform.sizeDelta
|
||||
end
|
||||
end
|
||||
-- 刷新组件大小
|
||||
-- 修正组件位置
|
||||
function MoneyNumView:RefreshOffsetPosition()
|
||||
if not self.offsetPosition then
|
||||
self.offsetPosition = Vector3.New(0, 0)
|
||||
self.offsetPosition = Vector2.New(0, 0)
|
||||
return
|
||||
end
|
||||
if self.viewType == MoneyNumViewType.Text_Vertical or self.viewType == MoneyNumViewType.Text_Horizontal then
|
||||
|
|
@ -239,6 +246,20 @@ function MoneyNumView:RefreshOffsetPosition()
|
|||
self.Image_Num_Horizontal.transform.localPosition = self.offsetPosition
|
||||
end
|
||||
end
|
||||
-- 修正组件角度
|
||||
function MoneyNumView:RefreshOffsetRotation()
|
||||
if not self.offsetRotation then
|
||||
self.offsetRotation = Vector3.New(0, 0, 0)
|
||||
return
|
||||
end
|
||||
if self.viewType == MoneyNumViewType.Text_Vertical or self.viewType == MoneyNumViewType.Text_Horizontal then
|
||||
self.Text_Num.transform.rotation = Quaternion.Euler(self.offsetRotation)
|
||||
elseif self.viewType == MoneyNumViewType.Image_Vertical then
|
||||
self.Image_Num_Vertical.transform.rotation = Quaternion.Euler(self.offsetRotation)
|
||||
elseif self.viewType == MoneyNumViewType.Image_Horizontal then
|
||||
self.Image_Num_Horizontal.transform.rotation = Quaternion.Euler(self.offsetRotation)
|
||||
end
|
||||
end
|
||||
|
||||
--界面关闭时调用(用于子类重写)
|
||||
function MoneyNumView:OnClose()
|
||||
|
|
|
|||
Loading…
Reference in New Issue