From 9fbd0cc17977a7ab6ba76ef8b09b310430c80f20 Mon Sep 17 00:00:00 2001 From: Mingu Kim Date: Mon, 3 Feb 2025 01:48:14 +0900 Subject: [PATCH] =?UTF-8?q?=EB=AA=AC=EC=8A=A4=ED=84=B0=20=ED=94=8C?= =?UTF-8?q?=EB=A0=88=EC=9D=B4=EC=96=B4=EC=97=90=EA=B2=8C=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99=ED=95=98=EB=8A=94=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Resources/UI/Prefabs/UI.PauseUI.prefab | 16 +- .../Personal Scenes/dev_mingu/Ingame.unity | 157 +++--------------- .../Gameton/Scripts/Monster/MonsterControl.cs | 35 ++++ .../Scripts/Monster/MonsterControl.cs.meta | 11 ++ .../Assets/Gameton/Scripts/UI/IngameUI.cs | 7 +- .../Assets/Gameton/Scripts/UI/PauseUI.cs | 9 +- 6 files changed, 90 insertions(+), 145 deletions(-) create mode 100644 Gameton-06/Assets/Gameton/Scripts/Monster/MonsterControl.cs create mode 100644 Gameton-06/Assets/Gameton/Scripts/Monster/MonsterControl.cs.meta diff --git a/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/UI.PauseUI.prefab b/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/UI.PauseUI.prefab index 69921006..86931f1a 100644 --- a/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/UI.PauseUI.prefab +++ b/Gameton-06/Assets/Gameton/Resources/UI/Prefabs/UI.PauseUI.prefab @@ -121,7 +121,19 @@ MonoBehaviour: m_TargetGraphic: {fileID: 2121651617368398431} m_OnClick: m_PersistentCalls: - m_Calls: [] + m_Calls: + - m_Target: {fileID: 5289490854944505444} + m_TargetAssemblyTypeName: TON.PauseUI, Assembly-CSharp + m_MethodName: OnPressContinueButton + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 --- !u!1 &685402085287606602 GameObject: m_ObjectHideFlags: 0 @@ -1456,5 +1468,3 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 94f5b0c2758d43b42a74f7fe4ae3a7e4, type: 3} m_Name: m_EditorClassIdentifier: - resumeButton: {fileID: 5341286469171996293} - quitButton: {fileID: 0} diff --git a/Gameton-06/Assets/Gameton/Scenes/Personal Scenes/dev_mingu/Ingame.unity b/Gameton-06/Assets/Gameton/Scenes/Personal Scenes/dev_mingu/Ingame.unity index 32653274..1210ff77 100644 --- a/Gameton-06/Assets/Gameton/Scenes/Personal Scenes/dev_mingu/Ingame.unity +++ b/Gameton-06/Assets/Gameton/Scenes/Personal Scenes/dev_mingu/Ingame.unity @@ -122,6 +122,24 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} +--- !u!1 &141676821 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 866829735663616562, guid: 1e126f96ebcf4245a3328353992d46f6, type: 3} + m_PrefabInstance: {fileID: 720822433} + m_PrefabAsset: {fileID: 0} +--- !u!114 &141676830 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 141676821} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d5b05a0586cd17f47a3c35acaac06e0f, type: 3} + m_Name: + m_EditorClassIdentifier: + speed: 3 --- !u!1 &257363987 GameObject: m_ObjectHideFlags: 0 @@ -478,7 +496,10 @@ PrefabInstance: m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] - m_AddedComponents: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 866829735663616562, guid: 1e126f96ebcf4245a3328353992d46f6, type: 3} + insertIndex: -1 + addedObject: {fileID: 141676830} m_SourcePrefab: {fileID: 100100000, guid: 1e126f96ebcf4245a3328353992d46f6, type: 3} --- !u!1 &770762291 GameObject: @@ -9836,139 +9857,6 @@ Tilemap: e31: 0 e32: 0 e33: 1 ---- !u!1001 &959466699 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 2230928671015106332, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} - propertyPath: m_Name - value: UI.InGameUI - objectReference: {fileID: 0} - - target: {fileID: 2230928671015106332, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} - propertyPath: m_IsActive - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2587651429737153657, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} - propertyPath: m_AnchorMax.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 2587651429737153657, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} - propertyPath: m_AnchorMin.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 2587651429737153657, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} - propertyPath: m_AnchoredPosition.x - value: 75 - objectReference: {fileID: 0} - - target: {fileID: 2587651429737153657, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} - propertyPath: m_AnchoredPosition.y - value: -50 - objectReference: {fileID: 0} - - target: {fileID: 5957244545150369457, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} - propertyPath: m_Pivot.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5957244545150369457, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} - propertyPath: m_Pivot.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5957244545150369457, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} - propertyPath: m_AnchorMax.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5957244545150369457, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} - propertyPath: m_AnchorMax.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5957244545150369457, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} - propertyPath: m_AnchorMin.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5957244545150369457, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5957244545150369457, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} - propertyPath: m_SizeDelta.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5957244545150369457, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} - propertyPath: m_SizeDelta.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5957244545150369457, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5957244545150369457, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5957244545150369457, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5957244545150369457, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 5957244545150369457, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5957244545150369457, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5957244545150369457, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5957244545150369457, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5957244545150369457, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5957244545150369457, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5957244545150369457, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5957244545150369457, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6573351524042496593, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} - propertyPath: m_AnchorMax.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 6573351524042496593, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} - propertyPath: m_AnchorMin.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 6573351524042496593, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} - propertyPath: m_AnchoredPosition.x - value: 225 - objectReference: {fileID: 0} - - target: {fileID: 6573351524042496593, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} - propertyPath: m_AnchoredPosition.y - value: -50 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: a3cb38f00e7fb8b4fbb78fd1f7590659, type: 3} --- !u!1 &1185367601 GameObject: m_ObjectHideFlags: 0 @@ -12460,4 +12348,3 @@ SceneRoots: - {fileID: 1555992584} - {fileID: 257363990} - {fileID: 720822433} - - {fileID: 959466699} diff --git a/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterControl.cs b/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterControl.cs new file mode 100644 index 00000000..109c6240 --- /dev/null +++ b/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterControl.cs @@ -0,0 +1,35 @@ +using System.Collections; +using System.Collections.Generic; +using System.Numerics; +using UnityEngine; + +namespace TON +{ + public class MonsterControl : MonoBehaviour + { + public float speed = 2; + + GameObject target; + + // Start is called before the first frame update + void Start() + { + target = GameObject.FindGameObjectWithTag("Player"); + } + + // Update is called once per frame + void Update() + { + + } + + private void FixedUpdate() + { + // 타겟의 위치에서 내 현제 위치를 뺌 + UnityEngine.Vector2 direction = target.transform.position - transform.position; + + // 방향 * 속도 * 시간간격 + transform.Translate(direction.normalized * speed * Time.deltaTime); + } + } +} diff --git a/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterControl.cs.meta b/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterControl.cs.meta new file mode 100644 index 00000000..544787c7 --- /dev/null +++ b/Gameton-06/Assets/Gameton/Scripts/Monster/MonsterControl.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d5b05a0586cd17f47a3c35acaac06e0f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Gameton-06/Assets/Gameton/Scripts/UI/IngameUI.cs b/Gameton-06/Assets/Gameton/Scripts/UI/IngameUI.cs index 29397246..01fd8220 100644 --- a/Gameton-06/Assets/Gameton/Scripts/UI/IngameUI.cs +++ b/Gameton-06/Assets/Gameton/Scripts/UI/IngameUI.cs @@ -34,13 +34,8 @@ namespace TON { UIManager.Show(UIList.PauseUI); - Debug.Log("버튼 클릭"); - - // UIManager.Show(UIList.PauseUI); - - // 게임 일시 정지 - // Time.timeScale = 0f; + Time.timeScale = 0f; } } diff --git a/Gameton-06/Assets/Gameton/Scripts/UI/PauseUI.cs b/Gameton-06/Assets/Gameton/Scripts/UI/PauseUI.cs index d7620dc1..a1ef258c 100644 --- a/Gameton-06/Assets/Gameton/Scripts/UI/PauseUI.cs +++ b/Gameton-06/Assets/Gameton/Scripts/UI/PauseUI.cs @@ -7,6 +7,13 @@ namespace TON { public class PauseUI : UIBase { - + // 컨티뉴 버튼 선택 시 + public void OnPressContinueButton() + { + // UI 숨김 + UIManager.Hide(UIList.PauseUI); + // 게임 재생 + Time.timeScale = 1f; + } } }