Merge pull request 'Scene Gizmo Drag 기능' (#213) from pgd/20250716_4 into main
Reviewed-on: http://220.90.135.190:3000/UVCXR/Studio/pulls/213
This commit was merged in pull request #213.
This commit is contained in:
@@ -12,9 +12,9 @@ namespace Studio.RuntimeGizmo
|
||||
{
|
||||
}
|
||||
|
||||
public class SceneGizmoRenderer : MonoBehaviour, IPointerClickHandler, IDragHandler
|
||||
public class SceneGizmoRenderer : MonoBehaviour, IPointerClickHandler, IDragHandler, IBeginDragHandler
|
||||
#if UNITY_EDITOR || UNITY_STANDALONE || UNITY_WEBGL || UNITY_FACEBOOK || UNITY_WSA || UNITY_WSA_10_0
|
||||
, IPointerEnterHandler, IPointerExitHandler
|
||||
, IPointerEnterHandler, IPointerExitHandler
|
||||
#else
|
||||
, IPointerDownHandler, IPointerUpHandler
|
||||
#endif
|
||||
@@ -53,7 +53,10 @@ namespace Studio.RuntimeGizmo
|
||||
public ComponentClickedEvent OnComponentClicked { get { return m_onComponentClicked; } }
|
||||
#pragma warning restore 0649
|
||||
|
||||
private void Awake()
|
||||
private Vector2 dragBeginPos;
|
||||
private Vector2 curGizmoPos;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
imageHolderTR = (RectTransform) imageHolder.transform;
|
||||
controller = (SceneGizmoController) Instantiate( controller );
|
||||
@@ -96,9 +99,17 @@ namespace Studio.RuntimeGizmo
|
||||
m_onComponentClicked.Invoke( hitComponent );
|
||||
}
|
||||
|
||||
public void OnDrag( PointerEventData eventData )
|
||||
public void OnBeginDrag(PointerEventData eventData)
|
||||
{
|
||||
dragBeginPos = eventData.position;
|
||||
curGizmoPos = transform.position;
|
||||
}
|
||||
|
||||
public void OnDrag( PointerEventData eventData)
|
||||
{
|
||||
}
|
||||
Vector2 moveOffset = eventData.position - dragBeginPos;
|
||||
transform.position = curGizmoPos + moveOffset;
|
||||
}
|
||||
|
||||
private Vector3 GetNormalizedPointerPosition( PointerEventData eventData )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user