From 0d2a8a5e2cd85157de90db743509ecba55da590c Mon Sep 17 00:00:00 2001 From: Jeonghyeon Ha Date: Tue, 15 Jul 2025 11:29:11 +0900 Subject: [PATCH] =?UTF-8?q?DDD-43=20=EB=B0=B0=20=EC=9D=B4=EB=8F=99=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84=EC=9D=84=20=EC=9C=84=ED=95=9C=20=EA=B8=B0?= =?UTF-8?q?=EB=B3=B8=20=EC=9D=B8=ED=92=8B=20=EB=B0=8F=20=EB=94=94=EB=B2=84?= =?UTF-8?q?=EA=B7=B8=20=EB=93=9C=EB=A1=9C=20=EA=B8=B0=EB=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/01.Scenes/77.SailTest_Ship.unity | 58 +++---- Assets/0_Voyage/Ship/Player/PlayerShip.prefab | 60 ++++++++ .../0_Voyage/VoyageInputAction.inputactions | 144 ++++++++++++++++++ .../VoyageInputAction.inputactions.meta | 14 ++ .../_Scripts/Ship/VoyagePlayerShipMovement.cs | 68 +++++++++ .../Ship/VoyagePlayerShipMovement.cs.meta | 2 + Assets/ShipTest/Ship.mat | 2 +- ProjectSettings/ProjectSettings.asset | 3 +- 8 files changed, 312 insertions(+), 39 deletions(-) create mode 100644 Assets/0_Voyage/VoyageInputAction.inputactions create mode 100644 Assets/0_Voyage/VoyageInputAction.inputactions.meta create mode 100644 Assets/0_Voyage/_Scripts/Ship/VoyagePlayerShipMovement.cs create mode 100644 Assets/0_Voyage/_Scripts/Ship/VoyagePlayerShipMovement.cs.meta diff --git a/Assets/01.Scenes/77.SailTest_Ship.unity b/Assets/01.Scenes/77.SailTest_Ship.unity index 609b98641..e741d3385 100644 --- a/Assets/01.Scenes/77.SailTest_Ship.unity +++ b/Assets/01.Scenes/77.SailTest_Ship.unity @@ -90187,7 +90187,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 943285313} serializedVersion: 2 - m_LocalRotation: {x: 0.19018528, y: 2.6343017e-15, z: -5.103197e-16, w: 0.9817482} + m_LocalRotation: {x: 0.22409342, y: 0, z: 0, w: 0.97456765} m_LocalPosition: {x: 0, y: 8.74, z: -18} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 @@ -90206,8 +90206,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 72ece51f2901e7445ab60da3685d6b5f, type: 3} m_Name: m_EditorClassIdentifier: - ShowDebugText: 1 - ShowCameraFrustum: 1 + ShowDebugText: 0 + ShowCameraFrustum: 0 IgnoreTimeScale: 0 WorldUpOverride: {fileID: 0} ChannelMask: -1 @@ -141074,7 +141074,7 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1413354196} serializedVersion: 2 - m_LocalRotation: {x: -0, y: 0.49685073, z: -0, w: 0.86783606} + m_LocalRotation: {x: -0, y: 0.7816503, z: -0, w: 0.62371695} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 @@ -152374,7 +152374,7 @@ GameObject: - component: {fileID: 1498712852} - component: {fileID: 1498712855} - component: {fileID: 1498712854} - - component: {fileID: 1498712853} + - component: {fileID: 1498712856} m_Layer: 9 m_Name: CinemachineCamera_Back m_TagString: Untagged @@ -152390,42 +152390,13 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1498712851} serializedVersion: 2 - m_LocalRotation: {x: 0.1901853, y: 2.5158583e-15, z: 1.0109272e-16, w: 0.9817482} + m_LocalRotation: {x: 0.22409342, y: 0, z: 0, w: 0.97456765} m_LocalPosition: {x: 0, y: 8.74, z: -18} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1885259736} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &1498712853 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1498712851} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: f38bda98361e1de48a4ca2bd86ea3c17, type: 3} - m_Name: - m_EditorClassIdentifier: - Composition: - ScreenPosition: {x: 0, y: -0.0019762814} - DeadZone: - Enabled: 0 - Size: {x: 0.2, y: 0.2} - HardLimits: - Enabled: 0 - Size: {x: 0.8, y: 0.8} - Offset: {x: 0, y: 0} - CenterOnActivate: 1 - TargetOffset: {x: 0, y: 1.54, z: 0} - Damping: {x: 0.5, y: 0.5} - Lookahead: - Enabled: 0 - Time: 0 - Smoothing: 0 - IgnoreY: 0 --- !u!114 &1498712854 MonoBehaviour: m_ObjectHideFlags: 0 @@ -152488,6 +152459,19 @@ MonoBehaviour: BarrelClipping: 0.25 Anamorphism: 0 BlendHint: 0 +--- !u!114 &1498712856 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1498712851} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1e8b78ac948f05a46a6d8339a503172b, type: 3} + m_Name: + m_EditorClassIdentifier: + LookAtOffset: {x: 0, y: 0, z: 0} --- !u!1 &1499148128 GameObject: m_ObjectHideFlags: 0 @@ -154961,7 +154945,7 @@ Transform: m_GameObject: {fileID: 1528083691} serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 1.4793639, y: 16.521343, z: -36.3647} + m_LocalPosition: {x: 0, y: 8.74, z: -18} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: @@ -194219,7 +194203,7 @@ Transform: serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 20, y: 20, z: 20} + m_LocalScale: {x: 0.15, y: 0.15, z: 0.15} m_ConstrainProportionsScale: 0 m_Children: - {fileID: 1790236138} diff --git a/Assets/0_Voyage/Ship/Player/PlayerShip.prefab b/Assets/0_Voyage/Ship/Player/PlayerShip.prefab index f516ec428..bd2f78a0b 100644 --- a/Assets/0_Voyage/Ship/Player/PlayerShip.prefab +++ b/Assets/0_Voyage/Ship/Player/PlayerShip.prefab @@ -10,6 +10,8 @@ GameObject: m_Component: - component: {fileID: 7177504742663284911} - component: {fileID: 1657872600039613395} + - component: {fileID: 2479726504690309911} + - component: {fileID: -1082383067592254908} m_Layer: 0 m_Name: PlayerShip m_TagString: Untagged @@ -45,6 +47,64 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 1b8549feefedd4d37a3936f5a3ae3fb8, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!114 &2479726504690309911 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1553910019582315619} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 62899f850307741f2a39c98a8b639597, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Actions: {fileID: -944628639613478452, guid: 646f5a2712aec4a0d9492587d23e9584, type: 3} + m_NotificationBehavior: 2 + m_UIInputModule: {fileID: 0} + m_DeviceLostEvent: + m_PersistentCalls: + m_Calls: [] + m_DeviceRegainedEvent: + m_PersistentCalls: + m_Calls: [] + m_ControlsChangedEvent: + m_PersistentCalls: + m_Calls: [] + m_ActionEvents: + - m_PersistentCalls: + m_Calls: + - m_Target: {fileID: -1082383067592254908} + m_TargetAssemblyTypeName: VoyagePlayerShipMovement, Assembly-CSharp + m_MethodName: OnMove + m_Mode: 0 + 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 + m_ActionId: a55441ed-e841-44cd-9097-5d0193fa406a + m_ActionName: 'Voyage/Move[/Keyboard/w,/Keyboard/upArrow,/Keyboard/s,/Keyboard/downArrow,/Keyboard/a,/Keyboard/leftArrow,/Keyboard/d,/Keyboard/rightArrow]' + m_NeverAutoSwitchControlSchemes: 0 + m_DefaultControlScheme: + m_DefaultActionMap: Voyage + m_SplitScreenIndex: -1 + m_Camera: {fileID: 0} +--- !u!114 &-1082383067592254908 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1553910019582315619} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2607481b15fd548b18ca4897db56ab3f, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &6407855916708530114 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/0_Voyage/VoyageInputAction.inputactions b/Assets/0_Voyage/VoyageInputAction.inputactions new file mode 100644 index 000000000..986a58b45 --- /dev/null +++ b/Assets/0_Voyage/VoyageInputAction.inputactions @@ -0,0 +1,144 @@ +{ + "name": "VoyageInputAction", + "maps": [ + { + "name": "Voyage", + "id": "d93e610e-8799-4d7b-a03a-53a7350ea4e3", + "actions": [ + { + "name": "Move", + "type": "Value", + "id": "a55441ed-e841-44cd-9097-5d0193fa406a", + "expectedControlType": "Vector2", + "processors": "", + "interactions": "", + "initialStateCheck": true + } + ], + "bindings": [ + { + "name": "", + "id": "07e2e88b-19a4-492a-bb6e-477a79caf78d", + "path": "/leftStick", + "interactions": "", + "processors": "", + "groups": ";Gamepad", + "action": "Move", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "WASD", + "id": "88163144-1dc8-4b91-90b7-480ef0f731ff", + "path": "Dpad", + "interactions": "", + "processors": "", + "groups": "", + "action": "Move", + "isComposite": true, + "isPartOfComposite": false + }, + { + "name": "up", + "id": "5e78c955-772b-4110-b9ec-1d3b1fa4e44d", + "path": "/w", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "up", + "id": "d5604539-9a5a-4d07-acd9-70ac31836b9b", + "path": "/upArrow", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "0535b78b-70bb-4cde-a90e-97ed54681107", + "path": "/s", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "59888646-6c80-4780-9988-5c86276440fa", + "path": "/downArrow", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "f5aed17b-d203-4d12-9fed-038a6f77763b", + "path": "/a", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "dcf9672c-0be6-4081-b274-815f47063229", + "path": "/leftArrow", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "38cb85bf-410b-4efa-b236-df3058449b76", + "path": "/d", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "9a2660b3-1aa8-492d-aa54-65d111ef6262", + "path": "/rightArrow", + "interactions": "", + "processors": "", + "groups": ";Keyboard&Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "", + "id": "e60cbff8-92ff-48f1-9fab-5f36544e0e5f", + "path": "/stick", + "interactions": "", + "processors": "", + "groups": "Joystick", + "action": "Move", + "isComposite": false, + "isPartOfComposite": false + } + ] + } + ], + "controlSchemes": [] +} \ No newline at end of file diff --git a/Assets/0_Voyage/VoyageInputAction.inputactions.meta b/Assets/0_Voyage/VoyageInputAction.inputactions.meta new file mode 100644 index 000000000..3c9e2a2d9 --- /dev/null +++ b/Assets/0_Voyage/VoyageInputAction.inputactions.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 646f5a2712aec4a0d9492587d23e9584 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 8404be70184654265930450def6a9037, type: 3} + generateWrapperCode: 0 + wrapperCodePath: + wrapperClassName: + wrapperCodeNamespace: diff --git a/Assets/0_Voyage/_Scripts/Ship/VoyagePlayerShipMovement.cs b/Assets/0_Voyage/_Scripts/Ship/VoyagePlayerShipMovement.cs new file mode 100644 index 000000000..90b2eb3dc --- /dev/null +++ b/Assets/0_Voyage/_Scripts/Ship/VoyagePlayerShipMovement.cs @@ -0,0 +1,68 @@ +using UnityEngine; +using UnityEngine.InputSystem; + +public class VoyagePlayerShipMovement : MonoBehaviour +{ + private void Start() + { +#if UNITY_EDITOR + // 현재 방향을 표시할 LineRenderer 설정 + forwardDirectionLine = CreateLineRenderer("CurrentDirectionLine", Color.green); + upDirectionLine = CreateLineRenderer("upDirectionLine", Color.yellow); + // 입력 방향을 표시할 LineRenderer 설정 + inputDirectionLine = CreateLineRenderer("InputDirectionLine", Color.red); +#endif + } + + public void OnMove(InputAction.CallbackContext context) + { + Vector2 inputVector = context.ReadValue(); + + Vector3 currentForward = transform.forward; + Vector3 currentUp = transform.up; + Vector3 inputDirection = new Vector3(inputVector.x, 0, inputVector.y).normalized; + + + + + +#if UNITY_EDITOR + DrawDebugLine(forwardDirectionLine, currentForward); + DrawDebugLine(upDirectionLine, currentUp); + DrawDebugLine(inputDirectionLine, inputDirection); +#endif + } + + // Debug draw below... +#if UNITY_EDITOR + private LineRenderer inputDirectionLine; + private LineRenderer forwardDirectionLine; + private LineRenderer upDirectionLine; + private LineRenderer CreateLineRenderer(string name, Color color) + { + GameObject lineObj = new GameObject(name); + lineObj.transform.SetParent(transform); + LineRenderer line = lineObj.AddComponent(); + + // LineRenderer 기본 설정 + line.startWidth = 0.1f; + line.endWidth = 0.1f; + line.material = new Material(Shader.Find("Universal Render Pipeline/Unlit")); + line.startColor = color; + line.endColor = color; + line.positionCount = 2; + + line.material.color = color; + + return line; + } + private void DrawDebugLine(LineRenderer renderer, Vector3 direction) + { + const float lineLength = 4; + Vector3 position = transform.position; + // 현재 방향 라인 업데이트 (파란색) + renderer.SetPosition(0, position); + renderer.SetPosition(1, position + direction * lineLength); + } +#endif +} \ No newline at end of file diff --git a/Assets/0_Voyage/_Scripts/Ship/VoyagePlayerShipMovement.cs.meta b/Assets/0_Voyage/_Scripts/Ship/VoyagePlayerShipMovement.cs.meta new file mode 100644 index 000000000..42751ed25 --- /dev/null +++ b/Assets/0_Voyage/_Scripts/Ship/VoyagePlayerShipMovement.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 2607481b15fd548b18ca4897db56ab3f \ No newline at end of file diff --git a/Assets/ShipTest/Ship.mat b/Assets/ShipTest/Ship.mat index 7f13e33e1..30a938d19 100644 --- a/Assets/ShipTest/Ship.mat +++ b/Assets/ShipTest/Ship.mat @@ -33,7 +33,7 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _BaseMap: - m_Texture: {fileID: 2800000, guid: b28a01dbcbf8f0c4c8b70e10b99d5a28, type: 3} + m_Texture: {fileID: 2800000, guid: 9fab180d66628484a9bf08ce8bbd51c8, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _BlendTex: diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 39c526bd5..f4f1155fc 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -877,7 +877,8 @@ PlayerSettings: Android: 1 Standalone: 1 il2cppCompilerConfiguration: {} - il2cppCodeGeneration: {} + il2cppCodeGeneration: + Standalone: 1 il2cppStacktraceInformation: {} managedStrippingLevel: Android: 1