Commit ba6b0e6d authored by 18손재민's avatar 18손재민

플레이어 총알 쏘기 완료, 머지 완료

parent 7f097902
......@@ -1432,8 +1432,10 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
head: {fileID: 3233955354714130270}
shootingArm: {fileID: 494213313239917623}
shootingArm: {fileID: 7838800661811206189}
shootingFinger: {fileID: 494213313239918045}
armRotation: {x: 0, y: 0, z: 0, w: 0}
currentFloor: {fileID: 0}
--- !u!1 &494213313239918029
GameObject:
m_ObjectHideFlags: 0
......@@ -2122,14 +2124,14 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 494213313239918065}
m_LocalRotation: {x: -0.046910297, y: -0.005540491, z: -0.012098737, w: 0.99881047}
m_LocalRotation: {x: -0.059248388, y: -0.0022251606, z: 0.02602184, w: 0.99790156}
m_LocalPosition: {x: 6.938353e-10, y: 0.0029668214, z: -8.381903e-11}
m_LocalScale: {x: 0.99999994, y: 1.0000002, z: 1.0000001}
m_Children:
- {fileID: 494213313239497103}
m_Father: {fileID: 494213313239496727}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_LocalEulerAnglesHint: {x: -6.7840004, y: -0.43400002, z: 3.0130002}
--- !u!1 &494213313239918067
GameObject:
m_ObjectHideFlags: 0
......
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &5325636473742838123
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 995136353672390943}
m_Layer: 0
m_Name: Head
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &995136353672390943
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5325636473742838123}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0.75, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 8862060874303168219}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &8862060874303168220
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8862060874303168219}
- component: {fileID: 8862060874303168216}
- component: {fileID: 8862060874303168217}
- component: {fileID: 8862060874303168222}
- component: {fileID: 857076055737488221}
- component: {fileID: 8862060874303168218}
- component: {fileID: 5785432140392015245}
m_Layer: 8
m_Name: Player
m_TagString: Player
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8862060874303168219
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8862060874303168220}
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_Children:
- {fileID: 995136353672390943}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &8862060874303168216
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8862060874303168220}
m_Mesh: {fileID: 10208, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &8862060874303168217
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8862060874303168220}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100002, guid: 21bb8ae9866c4304198832331df496dc, type: 3}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!136 &8862060874303168222
CapsuleCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8862060874303168220}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
m_Radius: 0.5
m_Height: 2
m_Direction: 1
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &857076055737488221
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8862060874303168220}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ceb8a784e77658342887555993532b12, type: 3}
m_Name:
m_EditorClassIdentifier:
head: {fileID: 5325636473742838123}
--- !u!195 &8862060874303168218
NavMeshAgent:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8862060874303168220}
m_Enabled: 0
m_AgentTypeID: 0
m_Radius: 0.5
m_Speed: 5
m_Acceleration: 1000
avoidancePriority: 50
m_AngularSpeed: 300
m_StoppingDistance: 0
m_AutoTraverseOffMeshLink: 1
m_AutoBraking: 1
m_AutoRepath: 1
m_Height: 2
m_BaseOffset: 1
m_WalkableMask: 4294967295
m_ObstacleAvoidanceType: 4
--- !u!208 &5785432140392015245
NavMeshObstacle:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8862060874303168220}
m_Enabled: 1
serializedVersion: 3
m_Shape: 1
m_Extents: {x: 0.5, y: 1, z: 0.5}
m_MoveThreshold: 0.1
m_Carve: 1
m_CarveOnlyStationary: 0
m_Center: {x: 0, y: 0, z: 0}
m_TimeToStationary: 0.5
fileFormatVersion: 2
guid: 6ba287375b5ad4b458a7b7b99c6d6a08
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: ae6df86ab9243f74f8c5e9aab2cbca92
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
......@@ -8,7 +8,7 @@ public class CameraController : MonoBehaviour
public float dragSpeed;
Vector3 previousPos;
Vector3 previousAngle;
float shootingFov = 40f;
float shootingFov = 60f;
float mapFov = 20f;
float rotationX = 0;
float rotationY = 0;
......@@ -135,7 +135,7 @@ public class CameraController : MonoBehaviour
float mouseMoveValueY = Input.GetAxis("Mouse Y");
rotationX += mouseMoveValueX * sensitivity * Time.deltaTime;
rotationY += mouseMoveValueY * sensitivity * Time.deltaTime;
rotationY = Mathf.Clamp(rotationY, -50, 20);
rotationY = Mathf.Clamp(rotationY, -20, 10);
transform.eulerAngles = new Vector3(-rotationY, rotationX, 0);
}
}
......
......@@ -12,8 +12,9 @@ public class Player : MonoBehaviour
Coroutine playerArrivalCheck;
public GameObject head;
public GameObject shootingArm;
public Transform shootingArm;
public GameObject shootingFinger;
public Quaternion armRotation;
Animator anim;
public Floor currentFloor;
......@@ -110,6 +111,7 @@ public class Player : MonoBehaviour
void Start()
{
anim = GetComponent<Animator>();
armRotation = shootingArm.rotation;
}
// Update is called once per frame
......
......@@ -148,12 +148,18 @@ public class PlayerController : SingletonBehaviour<PlayerController>
void LateUpdate()
{
if (currentPlayer != null && currentPlayer.GetComponent<NavMeshAgent>().velocity.magnitude > 0)
transform.rotation = Quaternion.LookRotation(currentPlayer.GetComponent<NavMeshAgent>().velocity.normalized);
if (isPlayerShooting)
if(currentPlayer != null)
{
Quaternion destinationRotation = Quaternion.Euler(new Vector3(transform.eulerAngles.x, Camera.main.transform.eulerAngles.y, currentPlayer.transform.eulerAngles.z));
currentPlayer.transform.rotation = Quaternion.Lerp(currentPlayer.transform.rotation, destinationRotation, Time.deltaTime * 10);
if (currentPlayer.GetComponent<NavMeshAgent>().velocity.magnitude > 0)
transform.rotation = Quaternion.LookRotation(currentPlayer.GetComponent<NavMeshAgent>().velocity.normalized);
if (isPlayerShooting)
{
Quaternion destinationRotation = Quaternion.Euler(new Vector3(transform.eulerAngles.x, Camera.main.transform.eulerAngles.y, currentPlayer.transform.eulerAngles.z));
currentPlayer.transform.rotation = Quaternion.Lerp(currentPlayer.transform.rotation, destinationRotation, Time.deltaTime * 10);
currentPlayer.shootingArm.LookAt(Camera.main.transform.forward + Camera.main.transform.position);
}
else
currentPlayer.shootingArm.rotation = currentPlayer.armRotation;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment