해상도 변경 시 ToolBar 알림 UI 의 위치가 어긋나는 오류 수정 #128
@@ -35,7 +35,7 @@ public class Panel_ToolBar : PanelBase
|
||||
public Action<int> onClickCustomView;
|
||||
public Action onClickMiniMap;
|
||||
public Action onClickFloorControl;
|
||||
public Action<Vector3, string, bool> onAlarm;
|
||||
public Action<Vector2, string, bool> onAlarm;
|
||||
|
||||
public override void AfterAwake()
|
||||
{
|
||||
@@ -154,7 +154,10 @@ public class Panel_ToolBar : PanelBase
|
||||
var viewButtonName = currentViewButton.gameObject.name;
|
||||
var viewMode = viewButtonName.Substring(viewButtonName.IndexOf("_") + 1);
|
||||
|
||||
onAlarm?.Invoke(Button_CustomView.transform.position, $"{viewMode} 시점의 위치를 저장하였습니다.", true);
|
||||
var alarmButton = Button_CustomView.GetComponent<RectTransform>();
|
||||
Vector3 worldRightPos = alarmButton.TransformPoint(new Vector3(alarmButton.rect.width * (1 - alarmButton.pivot.x), 0, 0));
|
||||
|
||||
onAlarm?.Invoke(worldRightPos, $"{viewMode} 시점의 위치를 저장하였습니다.", true);
|
||||
}
|
||||
|
||||
private void OnClickShoulderView()
|
||||
@@ -164,7 +167,10 @@ public class Panel_ToolBar : PanelBase
|
||||
|
||||
if (floorIndex == 5)
|
||||
{
|
||||
onAlarm?.Invoke(Button_SholuderView.transform.position, "시점을 Shoulder View 로 전환할 수 없습니다.", false);
|
||||
var alarmButton = Button_SholuderView.GetComponent<RectTransform>();
|
||||
Vector3 worldRightPos = alarmButton.TransformPoint(new Vector3(alarmButton.rect.width * (1 - alarmButton.pivot.x), 0, 0));
|
||||
|
||||
onAlarm?.Invoke(worldRightPos, "시점을 Shoulder View 로 전환할 수 없습니다.", false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,9 +14,15 @@ public class Panel_ToolBarAlarm : PanelBase, IPopupPanel
|
||||
{
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
public void ActiveAlarm(Vector3 pos, string value, bool isSuccess)
|
||||
public void ActiveAlarm(Vector2 pos, string value, bool isSuccess)
|
||||
{
|
||||
transform.position = new Vector3(pos.x + offset.x, pos.y + offset.y, 0);
|
||||
RectTransform parentRectTransform = rectTransform.parent.GetComponent<RectTransform>();
|
||||
|
||||
Vector2 localPoint;
|
||||
var offset = new Vector2(rectTransform.rect.width / 2f, 0f);
|
||||
RectTransformUtility.ScreenPointToLocalPointInRectangle(parentRectTransform, pos, null, out localPoint);
|
||||
|
||||
rectTransform.anchoredPosition = localPoint + offset;
|
||||
gameObject.SetActive(true);
|
||||
|
||||
Content.SetText(value);
|
||||
|
||||
Reference in New Issue
Block a user