ed1e24be1d
1. 회전 시 펜스가 사라지거나 남았던 현상 해결 - 펜스의 LOD가 여러개여서 필요한것만 남기고 삭제 2. 실드 ui 조정 - 별도의 스크립트와 핸들러를 이용해 빈 오브젝트(앵커)에 소속하게 변경 - pc에서는 화면 우측 상단으로 이동 - 모바일에서는 버튼 안으로 이동 3. 폰트 변경
28 lines
739 B
C#
28 lines
739 B
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class ShieldRelocator : MonoBehaviour
|
|
{
|
|
public Transform pcAnchor; // PC 화면 위치
|
|
public Transform mobileAnchor; // 모바일 버튼 내부 위치
|
|
|
|
void Awake()
|
|
{
|
|
bool isMobile = Application.isMobilePlatform;
|
|
Transform targetParent = isMobile ? mobileAnchor : pcAnchor;
|
|
|
|
transform.SetParent(targetParent, false);
|
|
|
|
RectTransform rect = GetComponent<RectTransform>();
|
|
|
|
rect.pivot = new Vector2(0.5f, 0.5f);
|
|
|
|
rect.anchorMin = new Vector2(0.5f, 0.5f);
|
|
rect.anchorMax = new Vector2(0.5f, 0.5f);
|
|
|
|
rect.anchoredPosition = Vector2.zero;
|
|
|
|
LayoutRebuilder.ForceRebuildLayoutImmediate(rect);
|
|
}
|
|
}
|