설비 라이브러리 디자인 적용 및 작업 시간 분석 차트 기능 수정
This commit is contained in:
@@ -44,25 +44,12 @@ public class UI_BarChartData : UIBase
|
||||
Vector2 localPoint;
|
||||
RectTransformUtility.ScreenPointToLocalPointInRectangle(parentRectTransform, Input.mousePosition, null, out localPoint);
|
||||
|
||||
Vector2 parentSize = parentRectTransform.rect.size;
|
||||
Vector2 uiSize = rectTransform.rect.size;
|
||||
var parentSize = parentRectTransform.rect.size;
|
||||
var uiSize = rectTransform.rect.size;
|
||||
|
||||
float clampedX = Mathf.Clamp(localPoint.x + offset.x, -parentSize.x / 2 + uiSize.x / 2, parentSize.x / 2 - uiSize.x / 2);
|
||||
float clampedY = Mathf.Clamp(localPoint.y + offset.y, -parentSize.y / 2 + uiSize.y / 2, parentSize.y / 2 - uiSize.y / 2);
|
||||
|
||||
rectTransform.localPosition = new Vector2(clampedX, clampedY);
|
||||
|
||||
rectTransform.localPosition = new Vector2(clampedX, offset.y);
|
||||
gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
if (EventSystem.current.currentSelectedGameObject != null)
|
||||
return;
|
||||
|
||||
SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user