【金钱组件】添加旋转接口
parent
601e1c0971
commit
645fc52869
|
|
@ -204,6 +204,13 @@ function MoneyNumView:SetOffsetPosition(position)
|
||||||
self:RefreshOffsetPosition()
|
self:RefreshOffsetPosition()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function MoneyNumView:SetOffsetRotation(rotation)
|
||||||
|
if not rotation then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
self.offsetRotation = rotation
|
||||||
|
self:RefreshOffsetRotation()
|
||||||
|
end
|
||||||
--
|
--
|
||||||
-- function MoneyNumView:Update()
|
-- function MoneyNumView:Update()
|
||||||
-- -- 延迟3帧刷新大小
|
-- -- 延迟3帧刷新大小
|
||||||
|
|
@ -225,10 +232,10 @@ function MoneyNumView:RefreshSize()
|
||||||
self.transform.sizeDelta = self.Image_Num_Horizontal.transform.sizeDelta
|
self.transform.sizeDelta = self.Image_Num_Horizontal.transform.sizeDelta
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- 刷新组件大小
|
-- 修正组件位置
|
||||||
function MoneyNumView:RefreshOffsetPosition()
|
function MoneyNumView:RefreshOffsetPosition()
|
||||||
if not self.offsetPosition then
|
if not self.offsetPosition then
|
||||||
self.offsetPosition = Vector3.New(0, 0)
|
self.offsetPosition = Vector2.New(0, 0)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if self.viewType == MoneyNumViewType.Text_Vertical or self.viewType == MoneyNumViewType.Text_Horizontal then
|
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
|
self.Image_Num_Horizontal.transform.localPosition = self.offsetPosition
|
||||||
end
|
end
|
||||||
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()
|
function MoneyNumView:OnClose()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue