local halfW = 121 local halfH = 50 functionGuideDesPosView:CalcUiBound() ifnotself.m_desPos then return end
local value = Camera.main:WorldToScreenPoint(self.m_desPos) local x = value.x local y = value.y local z = value.z if x == self.m_lastX and y == self.m_lastY and z == self.m_lastZ then return end
if z < 0then ifself.contentTrans.gameObject.activeSelf then self.contentTrans.gameObject:SetActive(false) end return elseif z >= 0then ifself.m_lastZ >= 0then self.contentTrans.gameObject:SetActive(true) end end
local scaleX = 1920 / Screen.width local scaleY = 1080 / Screen.height
self.m_lastX = x self.m_lastY = y self.m_lastZ = z if (value.x + halfW > Screen.width) then x = Screen.width - halfW end
if (value.x - halfW < 0) then x = halfW end
if (value.y - halfH < 0) then y = halfH end
if (value.y + halfH > Screen.height) then y = Screen.height - halfH end