From 303ac7895f83e5ec60f571932dfe347bb20a17e8 Mon Sep 17 00:00:00 2001 From: Ino Date: Fri, 5 Sep 2025 06:08:38 +0900 Subject: [PATCH] =?UTF-8?q?=ED=8F=B0=ED=8A=B8=20=EC=95=84=EC=9B=83?= =?UTF-8?q?=EB=9D=BC=EC=9D=B8=20=EA=B0=92=20=EC=88=98=EC=A0=95=20=EC=95=A8?= =?UTF-8?q?=EB=B2=94=20=EC=A0=84=EC=B2=B4=ED=99=94=EB=A9=B4=20=EB=AA=A8?= =?UTF-8?q?=EB=93=9C=EC=97=90=EC=84=9C=20X=20=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0=20=EC=BB=A8=ED=8A=B8=EB=A1=A4=20+=20?= =?UTF-8?q?=EC=89=AC=ED=94=84=ED=8A=B8=20+=20X=20=EB=A5=BC=20=EB=88=84?= =?UTF-8?q?=EB=A5=B4=EB=A9=B4=20=ED=99=94=EB=A9=B4=20=EC=BA=A1=EC=B3=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Editor/ScreenshotTool.cs | 72 +++++++++ Assets/Editor/ScreenshotTool.cs.meta | 2 + Assets/Scenes/Main.unity | 140 +----------------- Assets/Scripts/My/CameraDragMove.cs | 95 +++++------- Assets/Scripts/UI/GamePanel/GamePanel.cs | 1 + Assets/Scripts/UI/ShowPanel.cs | 14 +- .../NotoSansKR-Regular - BoldOutline 2.mat | 4 +- 7 files changed, 131 insertions(+), 197 deletions(-) create mode 100644 Assets/Editor/ScreenshotTool.cs create mode 100644 Assets/Editor/ScreenshotTool.cs.meta diff --git a/Assets/Editor/ScreenshotTool.cs b/Assets/Editor/ScreenshotTool.cs new file mode 100644 index 0000000..f6b309d --- /dev/null +++ b/Assets/Editor/ScreenshotTool.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections; +using System.Diagnostics; +using System.IO; +using UnityEditor; +using UnityEngine; + +public class ScreenshotHelper : MonoBehaviour +{ + public static void Capture() + { + if (!Application.isPlaying) + { + UnityEngine.Debug.LogWarning("플레이 모드에서만 가능합니다."); + return; + } + + var go = new GameObject("ScreenshotHelper"); + go.hideFlags = HideFlags.HideAndDontSave; + go.AddComponent(); + } + + private void Start() + { + StartCoroutine(CaptureCoroutine()); + } + + private IEnumerator CaptureCoroutine() + { + yield return new WaitForEndOfFrame(); + + string projectRoot = Path.GetDirectoryName(Application.dataPath); + string screenshotFolder = Path.Combine(projectRoot, "ScreenShot"); + if (!Directory.Exists(screenshotFolder)) + Directory.CreateDirectory(screenshotFolder); + + string fileName = "Screenshot_" + DateTime.Now.ToString("yyyy-MM-dd_HHmmss") + ".png"; + string fullPath = Path.Combine(screenshotFolder, fileName); + + Texture2D tex = new Texture2D(Screen.width, Screen.height, TextureFormat.RGB24, false); + tex.ReadPixels(new Rect(0, 0, Screen.width, Screen.height), 0, 0); + tex.Apply(); + + File.WriteAllBytes(fullPath, tex.EncodeToPNG()); + Destroy(tex); + + UnityEngine.Debug.Log($"[ScreenshotTool] 스크린샷 저장됨: {fullPath}"); + + // Unity 다이얼로그 띄우기 + bool openFolder = EditorUtility.DisplayDialog( + "스크린샷 저장 완료", + $"{fileName}\n파일 위치를 여시겠습니까?", + "예", "아니오"); + + if (openFolder) + { + // 윈도우 탐색기 열기 + Process.Start("explorer.exe", $"/select,\"{fullPath}\""); + } + + Destroy(gameObject); + } +} + +public static class ScreenshotTool +{ + [MenuItem("Tools/Take Screenshot (PlayMode) %#x")] + public static void TakeScreenshotPlayMode() + { + ScreenshotHelper.Capture(); + } +} \ No newline at end of file diff --git a/Assets/Editor/ScreenshotTool.cs.meta b/Assets/Editor/ScreenshotTool.cs.meta new file mode 100644 index 0000000..b9ff66c --- /dev/null +++ b/Assets/Editor/ScreenshotTool.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 6e160963f7fea5742a801c1fcfd41391 \ No newline at end of file diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity index e92a5da..7151583 100644 --- a/Assets/Scenes/Main.unity +++ b/Assets/Scenes/Main.unity @@ -56520,6 +56520,8 @@ MonoBehaviour: AINameTMP: {fileID: 1889396053} t_PointMoney: {fileID: 1964419925} AIGoldTMP: {fileID: 632370172} + CurMission: 18 + CurSubMission: 5 CenterDeckRT: {fileID: 936323066} FloorRTs: - {fileID: 1429736703} @@ -98449,138 +98451,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1511115198} m_CullTransparentMesh: 1 ---- !u!1 &1512652386 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1512652387} - - component: {fileID: 1512652390} - - component: {fileID: 1512652389} - - component: {fileID: 1512652388} - m_Layer: 5 - m_Name: btn_x - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!224 &1512652387 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1512652386} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 2024650247} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 1, y: 1} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: -50, y: -50} - m_SizeDelta: {x: 100, y: 100} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1512652388 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1512652386} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_WrapAround: 0 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_SelectedTrigger: Selected - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 1512652389} - m_OnClick: - m_PersistentCalls: - m_Calls: - - m_Target: {fileID: 2090836414} - m_TargetAssemblyTypeName: ShowPanel, Assembly-CSharp - m_MethodName: OnClick_Btn - m_Mode: 3 - m_Arguments: - m_ObjectArgument: {fileID: 0} - m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine - m_IntArgument: 4 - m_FloatArgument: 0 - m_StringArgument: - m_BoolArgument: 0 - m_CallState: 2 ---- !u!114 &1512652389 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1512652386} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 21300000, guid: c7be9d948878f3d4abcff3f46819093e, type: 3} - m_Type: 0 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!222 &1512652390 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1512652386} - m_CullTransparentMesh: 1 --- !u!1 &1514929357 GameObject: m_ObjectHideFlags: 0 @@ -159047,7 +158917,6 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 2090836411} - - {fileID: 1512652387} - {fileID: 2140049025} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -169355,7 +169224,7 @@ MonoBehaviour: gos_off: - {fileID: 301590527} go_btns: {fileID: 2090836410} - go_fullscreenclose: {fileID: 1512652386} + isFull: 0 --- !u!1 &2093703514 GameObject: m_ObjectHideFlags: 0 @@ -175587,7 +175456,7 @@ GameObject: - component: {fileID: 2140049025} - component: {fileID: 2140049026} m_Layer: 5 - m_Name: GameObject + m_Name: DragObj m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -175624,6 +175493,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: db478bbe5ace88542969013b0399df6a, type: 3} m_Name: m_EditorClassIdentifier: + m_ShowPanel: {fileID: 2090836414} cam: {fileID: 519420031} targetSprite: {fileID: 110351319} go_btnbg: {fileID: 2090836410} diff --git a/Assets/Scripts/My/CameraDragMove.cs b/Assets/Scripts/My/CameraDragMove.cs index 933ac25..17fc314 100644 --- a/Assets/Scripts/My/CameraDragMove.cs +++ b/Assets/Scripts/My/CameraDragMove.cs @@ -2,6 +2,7 @@ using UnityEngine; public class CameraDragMove : MonoBehaviour { + public ShowPanel m_ShowPanel; public Camera cam; // 이동시킬 카메라 public SpriteRenderer targetSprite; // 영역 기준이 되는 스프라이트 public GameObject go_btnbg; @@ -9,6 +10,7 @@ public class CameraDragMove : MonoBehaviour private Vector3 lastTouchPos; private Vector3 pressPos; // 입력 시작 지점 + Vector3 lastcamPos; private bool isDragging = false; void Reset() @@ -19,76 +21,57 @@ public class CameraDragMove : MonoBehaviour void Update() { #if UNITY_EDITOR || UNITY_STANDALONE - HandleMouseInput(); // 에디터/PC + if (Input.GetMouseButtonDown(0) || Input.GetMouseButton(0) || Input.GetMouseButtonUp(0)) + { + ProcessInput( + Input.GetMouseButtonDown(0), + Input.GetMouseButton(0), + Input.GetMouseButtonUp(0), + Input.mousePosition + ); + } #else - HandleTouchInput(); // 모바일 + if (Input.touchCount == 1) + { + Touch touch = Input.GetTouch(0); + ProcessInput( + touch.phase == TouchPhase.Began, + touch.phase == TouchPhase.Moved, + touch.phase == TouchPhase.Ended, + touch.position + ); + } #endif } - void HandleMouseInput() + void ProcessInput(bool began, bool moved, bool ended, Vector3 position) { - if (Input.GetMouseButtonDown(0)) + if (!m_ShowPanel.isFull) return; + + if (began) { - pressPos = Input.mousePosition; - lastTouchPos = Input.mousePosition; + pressPos = position; + lastTouchPos = position; + lastcamPos = cam.transform.position; isDragging = false; } - else if (Input.GetMouseButton(0)) + else if (moved) { - Vector3 deltaScreen = Input.mousePosition - pressPos; + Vector3 deltaWorld = cam.ScreenToWorldPoint(position) - cam.ScreenToWorldPoint(lastTouchPos); + deltaWorld.z = 0f; - isDragging = true; + cam.transform.position -= deltaWorld * dragSpeed; + ClampCameraPosition(); - if (isDragging) - { - Vector3 deltaWorld = cam.ScreenToWorldPoint(Input.mousePosition) - cam.ScreenToWorldPoint(lastTouchPos); - deltaWorld.z = 0f; + lastTouchPos = position; - cam.transform.position -= deltaWorld * dragSpeed; - ClampCameraPosition(); - - lastTouchPos = Input.mousePosition; - } + if (lastcamPos != cam.transform.position || Mathf.Abs(deltaWorld.x) >= 0.01f || Mathf.Abs(deltaWorld.y) >= 0.01f) + isDragging = true; } - else if (Input.GetMouseButtonUp(0)) + else if (ended) { - } - } - - void HandleTouchInput() - { - if (Input.touchCount == 1) - { - Touch touch = Input.GetTouch(0); - - switch (touch.phase) - { - case TouchPhase.Began: - pressPos = touch.position; - lastTouchPos = touch.position; - isDragging = false; - break; - - case TouchPhase.Moved: - Vector3 deltaScreen = (Vector3)touch.position - pressPos; - - isDragging = true; - - if (isDragging) - { - Vector3 deltaWorld = cam.ScreenToWorldPoint(touch.position) - cam.ScreenToWorldPoint(lastTouchPos); - deltaWorld.z = 0f; - - cam.transform.position -= deltaWorld * dragSpeed; - ClampCameraPosition(); - - lastTouchPos = touch.position; - } - break; - - case TouchPhase.Ended: - break; - } + if (!isDragging) + m_ShowPanel.OnClick_Btn(4); } } diff --git a/Assets/Scripts/UI/GamePanel/GamePanel.cs b/Assets/Scripts/UI/GamePanel/GamePanel.cs index 430ad50..b003e83 100644 --- a/Assets/Scripts/UI/GamePanel/GamePanel.cs +++ b/Assets/Scripts/UI/GamePanel/GamePanel.cs @@ -381,6 +381,7 @@ public partial class GamePanel : MonoBehaviour void Set_Mission() { + // 테스트 : 미션 100% //if (DSUtil.RandomTrue(0.1f + GameManager.DB.MissionAddRate)) if (true) { diff --git a/Assets/Scripts/UI/ShowPanel.cs b/Assets/Scripts/UI/ShowPanel.cs index 9a2b770..1a4cae4 100644 --- a/Assets/Scripts/UI/ShowPanel.cs +++ b/Assets/Scripts/UI/ShowPanel.cs @@ -6,8 +6,9 @@ public class ShowPanel : MonoBehaviour public Camera m_Cam; public SpriteRenderer i_image; public GameObject[] gos_off; - public GameObject go_btns, go_fullscreenclose; + public GameObject go_btns; + public bool isFull; int zoomStep = 0; public void Set(HuntingData data) @@ -15,9 +16,9 @@ public class ShowPanel : MonoBehaviour gameObject.SetActive(true); DSUtil.InActivateGameObjects(gos_off); go_btns.SetActive(true); - go_fullscreenclose.SetActive(false); i_image.sprite = data.HuntingImage; + isFull = false; zoomStep = 0; m_Cam.orthographicSize = 4f; m_Cam.transform.position = new Vector3(0f, 0f, -10f); @@ -56,7 +57,7 @@ public class ShowPanel : MonoBehaviour break; case 1: // 풀 스크린 go_btns.SetActive(false); - go_fullscreenclose.SetActive(true); + Invoke("Set_Full", Time.deltaTime); break; case 2: // 확대 (2단계까지만) ++zoomStep; @@ -70,9 +71,14 @@ public class ShowPanel : MonoBehaviour m_Cam.transform.position = new Vector3(0f, 0f, -10f); break; case 4: // UI 다시 보이기 + isFull = false; go_btns.SetActive(true); - go_fullscreenclose.SetActive(false); break; } } + + void Set_Full() + { + isFull = true; + } } diff --git a/Assets/TextMesh Pro/Resources/Fonts & Materials/NotoSansKR-Regular - BoldOutline 2.mat b/Assets/TextMesh Pro/Resources/Fonts & Materials/NotoSansKR-Regular - BoldOutline 2.mat index e3e12fe..f547d5c 100644 --- a/Assets/TextMesh Pro/Resources/Fonts & Materials/NotoSansKR-Regular - BoldOutline 2.mat +++ b/Assets/TextMesh Pro/Resources/Fonts & Materials/NotoSansKR-Regular - BoldOutline 2.mat @@ -70,10 +70,10 @@ Material: - _OutlineSoftness: 0 - _OutlineUVSpeedX: 0 - _OutlineUVSpeedY: 0 - - _OutlineWidth: 1 + - _OutlineWidth: 0.315 - _PerspectiveFilter: 0.875 - _Reflectivity: 10 - - _ScaleRatioA: 0.53781515 + - _ScaleRatioA: 0.8 - _ScaleRatioB: 0.41 - _ScaleRatioC: 0.41 - _ScaleX: 1