RF 층 버튼 변경 및 UI 드래그 오류 수정

This commit is contained in:
정영민
2025-04-08 12:28:18 +09:00
parent 77f7f6c102
commit 3cfc9d136a
10 changed files with 107 additions and 112 deletions

View File

@@ -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;
}
}
}

View File

@@ -295,7 +295,7 @@ MonoBehaviour:
m_Content: {fileID: 8100983100533929295}
m_Horizontal: 0
m_Vertical: 1
m_MovementType: 1
m_MovementType: 2
m_Elasticity: 0.1
m_Inertia: 1
m_DecelerationRate: 0.135

View File

@@ -694,7 +694,7 @@ MonoBehaviour:
m_Content: {fileID: 1664826789211949129}
m_Horizontal: 1
m_Vertical: 0
m_MovementType: 1
m_MovementType: 2
m_Elasticity: 0.1
m_Inertia: 1
m_DecelerationRate: 0.135

View File

@@ -343,7 +343,7 @@ MonoBehaviour:
m_Content: {fileID: 8638979772171968288}
m_Horizontal: 0
m_Vertical: 1
m_MovementType: 1
m_MovementType: 2
m_Elasticity: 0.1
m_Inertia: 1
m_DecelerationRate: 0.135
@@ -2320,9 +2320,9 @@ RectTransform:
- {fileID: 3587059684787867451}
m_Father: {fileID: 1904382343685541487}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 215.255, y: -347.375}
m_SizeDelta: {x: 340.51, y: 151.97}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &1617684694942205957
@@ -11292,7 +11292,7 @@ MonoBehaviour:
m_Content: {fileID: 1904382343685541487}
m_Horizontal: 0
m_Vertical: 1
m_MovementType: 1
m_MovementType: 2
m_Elasticity: 0.1
m_Inertia: 1
m_DecelerationRate: 0.135
@@ -15279,9 +15279,9 @@ RectTransform:
- {fileID: 1581751372906333712}
m_Father: {fileID: 1904382343685541487}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 215.25002, y: -120.69499}
m_SizeDelta: {x: 340.50003, y: 241.38998}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &8103516073146861605

View File

@@ -592,7 +592,7 @@ MonoBehaviour:
m_Content: {fileID: 3065632315239046984}
m_Horizontal: 0
m_Vertical: 1
m_MovementType: 1
m_MovementType: 2
m_Elasticity: 0.1
m_Inertia: 1
m_DecelerationRate: 0.135
@@ -1410,7 +1410,7 @@ MonoBehaviour:
m_Content: {fileID: 3522885334464503914}
m_Horizontal: 0
m_Vertical: 1
m_MovementType: 1
m_MovementType: 2
m_Elasticity: 0.1
m_Inertia: 1
m_DecelerationRate: 0.135

View File

@@ -435731,7 +435731,7 @@ PrefabInstance:
- target: {fileID: 6053503471138626323, guid: a74d4a3b763fd8d438c7fff5d89e9430,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 10.3
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6053503471138626323, guid: a74d4a3b763fd8d438c7fff5d89e9430,
type: 3}

View File

@@ -23,7 +23,15 @@ public class UI_FloorButton : UIBase
button = GetComponent<Button>();
var buttonText = GetComponentInChildren<TMP_Text>();
buttonText.SetText($"{value + 1}F");
if (value + 1 >= 6)
{
buttonText.SetText("RF");
}
else
{
buttonText.SetText($"{value + 1}F");
}
button.onClick.AddListener(OnClickButton);
originColor = button.image.color;

View File

@@ -72,6 +72,7 @@ public class Panel_ToolBar : PanelBase
if (!string.IsNullOrEmpty(destFilePath))
{
File.Delete(destFilePath);
File.Move(sourcePath, destFilePath);
}
else

View File

@@ -66,6 +66,8 @@ namespace CHN
var isActive = protocol.isSuccess;
Image_State.gameObject.SetActive(isActive);
var color = protocol.isSuccess ? new Color(0, 245, 0) : new Color(245, 0, 0);
ErrorMessage.color = color;
ErrorMessage.text = protocol.errorMessage;
}
}