RF 층 버튼 변경 및 UI 드래그 오류 수정
This commit is contained in:
@@ -59,51 +59,35 @@ namespace WI
|
||||
return result;
|
||||
}
|
||||
}
|
||||
//UI위에 마우스 있는경우
|
||||
public bool IsOnTheUI
|
||||
{
|
||||
get
|
||||
{
|
||||
if (IsPointerOverExcludedUI())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
var result = EventSystem.current.IsPointerOverGameObject();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
bool IsPointerOverExcludedUI()
|
||||
{
|
||||
PointerEventData pointerData = new PointerEventData(EventSystem.current);
|
||||
pointerData.position = Input.mousePosition;
|
||||
|
||||
List<RaycastResult> raycastResults = new List<RaycastResult>();
|
||||
EventSystem.current.RaycastAll(pointerData, raycastResults);
|
||||
|
||||
foreach(var raycastResult in raycastResults)
|
||||
{
|
||||
if ((LayerMask.GetMask("Default") & (1 << raycastResult.gameObject.layer)) != 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isPressed;
|
||||
protected virtual void LateUpdate()
|
||||
{
|
||||
if (IsPressedUI())
|
||||
return;
|
||||
|
||||
if (IsClickUI)
|
||||
return;
|
||||
if (IsOnTheUI)
|
||||
return;
|
||||
|
||||
input.GetInput();
|
||||
Movement();
|
||||
var limitCheck = maxRangeLimitter.MoveRangeLimit(nextPosition);
|
||||
LastPositioning(limitCheck);
|
||||
}
|
||||
private bool IsPressedUI()
|
||||
{
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
if (EventSystem.current.IsPointerOverGameObject())
|
||||
{
|
||||
isPressed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (Input.GetMouseButtonUp(0))
|
||||
{
|
||||
isPressed = false;
|
||||
}
|
||||
return isPressed;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user