DDD-43 배 이동 구현을 위한 기본 인풋 및 디버그 드로 기능
This commit is contained in:
parent
22ad52aa56
commit
0d2a8a5e2c
@ -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}
|
||||
|
@ -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
|
||||
|
144
Assets/0_Voyage/VoyageInputAction.inputactions
Normal file
144
Assets/0_Voyage/VoyageInputAction.inputactions
Normal file
@ -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": "<Gamepad>/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": "<Keyboard>/w",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": ";Keyboard&Mouse",
|
||||
"action": "Move",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": true
|
||||
},
|
||||
{
|
||||
"name": "up",
|
||||
"id": "d5604539-9a5a-4d07-acd9-70ac31836b9b",
|
||||
"path": "<Keyboard>/upArrow",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": ";Keyboard&Mouse",
|
||||
"action": "Move",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": true
|
||||
},
|
||||
{
|
||||
"name": "down",
|
||||
"id": "0535b78b-70bb-4cde-a90e-97ed54681107",
|
||||
"path": "<Keyboard>/s",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": ";Keyboard&Mouse",
|
||||
"action": "Move",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": true
|
||||
},
|
||||
{
|
||||
"name": "down",
|
||||
"id": "59888646-6c80-4780-9988-5c86276440fa",
|
||||
"path": "<Keyboard>/downArrow",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": ";Keyboard&Mouse",
|
||||
"action": "Move",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": true
|
||||
},
|
||||
{
|
||||
"name": "left",
|
||||
"id": "f5aed17b-d203-4d12-9fed-038a6f77763b",
|
||||
"path": "<Keyboard>/a",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": ";Keyboard&Mouse",
|
||||
"action": "Move",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": true
|
||||
},
|
||||
{
|
||||
"name": "left",
|
||||
"id": "dcf9672c-0be6-4081-b274-815f47063229",
|
||||
"path": "<Keyboard>/leftArrow",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": ";Keyboard&Mouse",
|
||||
"action": "Move",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": true
|
||||
},
|
||||
{
|
||||
"name": "right",
|
||||
"id": "38cb85bf-410b-4efa-b236-df3058449b76",
|
||||
"path": "<Keyboard>/d",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": ";Keyboard&Mouse",
|
||||
"action": "Move",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": true
|
||||
},
|
||||
{
|
||||
"name": "right",
|
||||
"id": "9a2660b3-1aa8-492d-aa54-65d111ef6262",
|
||||
"path": "<Keyboard>/rightArrow",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": ";Keyboard&Mouse",
|
||||
"action": "Move",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": true
|
||||
},
|
||||
{
|
||||
"name": "",
|
||||
"id": "e60cbff8-92ff-48f1-9fab-5f36544e0e5f",
|
||||
"path": "<Joystick>/stick",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "Joystick",
|
||||
"action": "Move",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"controlSchemes": []
|
||||
}
|
14
Assets/0_Voyage/VoyageInputAction.inputactions.meta
Normal file
14
Assets/0_Voyage/VoyageInputAction.inputactions.meta
Normal file
@ -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:
|
68
Assets/0_Voyage/_Scripts/Ship/VoyagePlayerShipMovement.cs
Normal file
68
Assets/0_Voyage/_Scripts/Ship/VoyagePlayerShipMovement.cs
Normal file
@ -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<Vector2>();
|
||||
|
||||
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>();
|
||||
|
||||
// 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
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2607481b15fd548b18ca4897db56ab3f
|
@ -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:
|
||||
|
@ -877,7 +877,8 @@ PlayerSettings:
|
||||
Android: 1
|
||||
Standalone: 1
|
||||
il2cppCompilerConfiguration: {}
|
||||
il2cppCodeGeneration: {}
|
||||
il2cppCodeGeneration:
|
||||
Standalone: 1
|
||||
il2cppStacktraceInformation: {}
|
||||
managedStrippingLevel:
|
||||
Android: 1
|
||||
|
Loading…
Reference in New Issue
Block a user