반응형 ui 적용

This commit is contained in:
김판돌 2025-01-31 03:04:25 +09:00
parent 6f72345ad6
commit 0feb2e8aaf
31 changed files with 39210 additions and 376 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,59 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ScreenMove : MonoBehaviour
{
[SerializeField] RectTransform rectTransform;
[SerializeField] RectTransform test_rectTransform;
readonly Vector2 stretch = new Vector2(0f, 0.5f);
readonly Vector2 middle = new Vector2(1f, 0.5f);
readonly Vector2 center = new Vector2(0.5f, 0.5f);
readonly Vector2 movePos = new Vector2(-58.5f, 20f);
readonly Vector2 moveSize = new Vector2(-343f, 100f);
readonly Vector2 idlePos = new Vector2(-58.5f, 20f);
readonly Vector2 idleSize = new Vector2(553f, 100f);
bool isMobile;
void Awake()
{
isMobile = Application.isMobilePlatform;
}
private void Start()
{
//모바일은 한번만 업데이트
if (isMobile)
{
rectTransform.sizeDelta = new Vector2(Screen.width, Screen.height);
}
}
private void Update()
{
//pc는 실시간 업데이트
if (!isMobile)
{
rectTransform.sizeDelta = new Vector2(Screen.width, Screen.height);
//1280
//Debug.Log($"{Screen.width} : {Screen.height}");
if (Screen.width < 1280)
{
test_rectTransform.anchorMin = center;
test_rectTransform.anchorMax = center;
test_rectTransform.anchoredPosition = idlePos;
test_rectTransform.sizeDelta = idleSize;
}
else
{
test_rectTransform.anchorMin = stretch;
test_rectTransform.anchorMax = middle;
test_rectTransform.anchoredPosition = movePos;
test_rectTransform.sizeDelta = moveSize;
}
//Debug.Log($"{test_rectTransform.anchoredPosition} : {test_rectTransform.sizeDelta}");
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 437 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 795 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 687 B

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@ -407,7 +407,7 @@ PlayerSettings:
m_APIs: 10000000 m_APIs: 10000000
m_Automatic: 1 m_Automatic: 1
m_BuildTargetVRSettings: [] m_BuildTargetVRSettings: []
m_DefaultShaderChunkSizeInMB: 16 m_DefaultShaderChunkSizeInMB: 32
m_DefaultShaderChunkCount: 0 m_DefaultShaderChunkCount: 0
openGLRequireES31: 0 openGLRequireES31: 0
openGLRequireES31AEP: 0 openGLRequireES31AEP: 0