포스트

Code Block - Image-Zoom

Code Block - Image-Zoom

Image-Zoom


  • UpdateScreenPos
    • setParent(null)
    • targetX = SWHalf - focusX
    • clamp(targetX, -SWH, SWH)
    • setParent(maskImage)
  • UpdateMaskPosUp
    • ~
    • targetY = focusY - SHH - maskHH + maskImageYDistance (var)
    • ~
  • UpdateMaskPos
    • maskWH = maskSizeDelta.x / 2
    • Move
      • targetX = focusX - SWH
      • clamp(targetX, maskWH - SWH, SWH - MWH)
      • mask.localPos = new ~
  • Darg Screen
    • curScale = rawImage.localScale.x
    • targetX = ri.localPos.deltaX
    • maxX = sWH * (curScale - 1)
    • clamp (target, -max, max)
    • ri.localPos = new (~)

임의로 Touch Event


  • PointerEventData = new (EventSystem.current) {position = new()}
  • EventSystem.current.RayCastAll(pointerEventData.list)
  • ExecuteEvents.Execute(targetObject_raycastObject, EventData, ExecuteEvents, PointerClickHandler )
이 기사는 저작권자의 CC BY 4.0 라이센스를 따릅니다.