protected Vector3 GetLocalPos (AnchorPoint ac, Transform trans)
{
if (anchorCamera == null || ac.targetCam == null)
return cachedTransform.localPosition;
Vector3 viewPos = ac.targetCam.WorldToViewportPoint(ac.target.position);
Vector3 pos
= mCam
.ViewportToWorldPoint(new Vector3
((viewPos
.x * ac
.targetCam.rect.width) + ac
.targetCam.rect.x,
(viewPos
.y * ac
.targetCam.rect.height) + ac
.targetCam.rect.y, viewPos
.z)); if (trans != null) pos = trans.InverseTransformPoint(pos);
pos.x = Mathf.Floor(pos.x + 0.5f);
pos.y = Mathf.Floor(pos.y + 0.5f);
return pos;
}