diff --git a/Assets/BowShooting.cs b/Assets/BowShooting.cs index 4e01728f366d0ffaf9fde469679441eadf12f79e..a6410feeb31c335738d32b8f77d2f87ea69b823e 100644 --- a/Assets/BowShooting.cs +++ b/Assets/BowShooting.cs @@ -27,7 +27,7 @@ public class BowShooting : MonoBehaviour { var mouseX = Input.GetAxis("Mouse X"); var mouseY = Input.GetAxis("Mouse Y"); - if (Input.GetButtonDown("Fire1")) + if (Input.GetButtonDown("Fire2")) { firePowerSpeed = 5; Debug.Log(bow.CanShoot()); @@ -37,7 +37,7 @@ public class BowShooting : MonoBehaviour { firePowerSpeed += Time.deltaTime * firePowerSpeed/2; } - if (fire && Input.GetButtonUp("Fire1")) + if (fire && Input.GetButtonUp("Fire2")) { bow.Shoot(firePowerSpeed); audioSource.Play(); diff --git a/Assets/Prefabs/Arrow.prefab b/Assets/Prefabs/Arrow.prefab index d767e7a6f91305f90fa2f0da19d43368d0e8ec0c..8b4bcaf4711320892eebf1e762a7bfc5b3138683 100644 --- a/Assets/Prefabs/Arrow.prefab +++ b/Assets/Prefabs/Arrow.prefab @@ -129,7 +129,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: da348a6d25867504f8136c70a27824c8, type: 3} m_Name: m_EditorClassIdentifier: - damage: 50 + damage: 100 torque: 5 rb: {fileID: 3552934484598700885} --- !u!65 &4596486912613088293 diff --git a/Assets/Scenes/Level_01.unity b/Assets/Scenes/Level_01.unity index 45fbe8c7638ad63497b4e3019f27c942ffe54a27..8392b4d682cd5f63d384d56e9b003d0a05c30c1d 100644 --- a/Assets/Scenes/Level_01.unity +++ b/Assets/Scenes/Level_01.unity @@ -203,138 +203,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9637472} m_CullTransparentMesh: 1 ---- !u!1 &33945473 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: c9a73f42c15ac4f48a92c5f435471f7f, type: 3} - m_PrefabInstance: {fileID: 216831668} - m_PrefabAsset: {fileID: 0} ---- !u!64 &33945475 -MeshCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 33945473} - m_Material: {fileID: 0} - m_IsTrigger: 0 - m_Enabled: 1 - serializedVersion: 4 - m_Convex: 1 - m_CookingOptions: 30 - m_Mesh: {fileID: 0} ---- !u!114 &33945476 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 33945473} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: cf07be16e2437734f8bb656151099f16, type: 3} - m_Name: - m_EditorClassIdentifier: - player: {fileID: 624092162} - swordCollider: {fileID: 33945475} - damagePerShot: 300 - spinSpeed: 500 - spinDuration: 0.5 ---- !u!82 &33945477 -AudioSource: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 33945473} - m_Enabled: 1 - serializedVersion: 4 - OutputAudioMixerGroup: {fileID: 24300002, guid: 5b84db49d40ea449aa4f3e3bd229ab5b, type: 2} - m_audioClip: {fileID: 8300000, guid: 352735f28fe99b643a447f955cee8df3, type: 3} - m_PlayOnAwake: 1 - m_Volume: 1 - m_Pitch: 1 - Loop: 0 - Mute: 0 - Spatialize: 0 - SpatializePostEffects: 0 - Priority: 128 - DopplerLevel: 1 - MinDistance: 1 - MaxDistance: 500 - Pan2D: 0 - rolloffMode: 0 - BypassEffects: 0 - BypassListenerEffects: 0 - BypassReverbZones: 0 - rolloffCustomCurve: - serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: 1 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - - serializedVersion: 3 - time: 1 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - panLevelCustomCurve: - serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - spreadCustomCurve: - serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: 0 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 - reverbZoneMixCustomCurve: - serializedVersion: 2 - m_Curve: - - serializedVersion: 3 - time: 0 - value: 1 - inSlope: 0 - outSlope: 0 - tangentMode: 0 - weightedMode: 0 - inWeight: 0.33333334 - outWeight: 0.33333334 - m_PreInfinity: 2 - m_PostInfinity: 2 - m_RotationOrder: 4 --- !u!1 &43179831 GameObject: m_ObjectHideFlags: 0 @@ -1617,87 +1485,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 193784240} m_CullTransparentMesh: 1 ---- !u!1001 &216831668 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 624092168} - m_Modifications: - - target: {fileID: -8679921383154817045, guid: c9a73f42c15ac4f48a92c5f435471f7f, type: 3} - propertyPath: m_RootOrder - value: 5 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: c9a73f42c15ac4f48a92c5f435471f7f, type: 3} - propertyPath: m_LocalScale.x - value: 1.2 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: c9a73f42c15ac4f48a92c5f435471f7f, type: 3} - propertyPath: m_LocalScale.y - value: 1.2 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: c9a73f42c15ac4f48a92c5f435471f7f, type: 3} - propertyPath: m_LocalScale.z - value: 1.2 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: c9a73f42c15ac4f48a92c5f435471f7f, type: 3} - propertyPath: m_LocalPosition.x - value: 0.41 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: c9a73f42c15ac4f48a92c5f435471f7f, type: 3} - propertyPath: m_LocalPosition.y - value: 0.54 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: c9a73f42c15ac4f48a92c5f435471f7f, type: 3} - propertyPath: m_LocalPosition.z - value: 0.89 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: c9a73f42c15ac4f48a92c5f435471f7f, type: 3} - propertyPath: m_LocalRotation.w - value: -0.09749435 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: c9a73f42c15ac4f48a92c5f435471f7f, type: 3} - propertyPath: m_LocalRotation.x - value: -0.9525225 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: c9a73f42c15ac4f48a92c5f435471f7f, type: 3} - propertyPath: m_LocalRotation.y - value: 0.28767118 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: c9a73f42c15ac4f48a92c5f435471f7f, type: 3} - propertyPath: m_LocalRotation.z - value: 0.02100116 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: c9a73f42c15ac4f48a92c5f435471f7f, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 10 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: c9a73f42c15ac4f48a92c5f435471f7f, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: -174.4 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: c9a73f42c15ac4f48a92c5f435471f7f, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 214.1 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: c9a73f42c15ac4f48a92c5f435471f7f, type: 3} - propertyPath: m_ConstrainProportionsScale - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 919132149155446097, guid: c9a73f42c15ac4f48a92c5f435471f7f, type: 3} - propertyPath: m_Name - value: sword2 - objectReference: {fileID: 0} - - target: {fileID: 919132149155446097, guid: c9a73f42c15ac4f48a92c5f435471f7f, type: 3} - propertyPath: m_IsActive - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 919132149155446097, guid: c9a73f42c15ac4f48a92c5f435471f7f, type: 3} - propertyPath: m_TagString - value: PlayerWeapon - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: c9a73f42c15ac4f48a92c5f435471f7f, type: 3} --- !u!1 &223198308 GameObject: m_ObjectHideFlags: 0 @@ -8964,7 +8751,7 @@ MonoBehaviour: RifleEnd: {fileID: 1003343662} Shotgun: {fileID: 2003766919} Bow: {fileID: 1391600422} - Sword: {fileID: 33945473} + Sword: {fileID: 881192533} --- !u!114 &624169576 stripped MonoBehaviour: m_CorrespondingSourceObject: {fileID: 6488902045712596028, guid: c133a0e3fc4f48c43a4306ef7a127b9a, type: 3} @@ -10192,6 +9979,72 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 862835713} m_CullTransparentMesh: 1 +--- !u!1001 &881192532 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 624092168} + m_Modifications: + - target: {fileID: 2490934396627426510, guid: 6f0f70ab322e39f4aa123adb2409d202, type: 3} + propertyPath: m_Name + value: sword + objectReference: {fileID: 0} + - target: {fileID: 3015796629085603444, guid: 6f0f70ab322e39f4aa123adb2409d202, type: 3} + propertyPath: m_RootOrder + value: 5 + objectReference: {fileID: 0} + - target: {fileID: 3015796629085603444, guid: 6f0f70ab322e39f4aa123adb2409d202, type: 3} + propertyPath: m_LocalPosition.x + value: 0.41 + objectReference: {fileID: 0} + - target: {fileID: 3015796629085603444, guid: 6f0f70ab322e39f4aa123adb2409d202, type: 3} + propertyPath: m_LocalPosition.y + value: 0.54 + objectReference: {fileID: 0} + - target: {fileID: 3015796629085603444, guid: 6f0f70ab322e39f4aa123adb2409d202, type: 3} + propertyPath: m_LocalPosition.z + value: 0.89 + objectReference: {fileID: 0} + - target: {fileID: 3015796629085603444, guid: 6f0f70ab322e39f4aa123adb2409d202, type: 3} + propertyPath: m_LocalRotation.w + value: -0.09749435 + objectReference: {fileID: 0} + - target: {fileID: 3015796629085603444, guid: 6f0f70ab322e39f4aa123adb2409d202, type: 3} + propertyPath: m_LocalRotation.x + value: -0.9525225 + objectReference: {fileID: 0} + - target: {fileID: 3015796629085603444, guid: 6f0f70ab322e39f4aa123adb2409d202, type: 3} + propertyPath: m_LocalRotation.y + value: 0.28767118 + objectReference: {fileID: 0} + - target: {fileID: 3015796629085603444, guid: 6f0f70ab322e39f4aa123adb2409d202, type: 3} + propertyPath: m_LocalRotation.z + value: 0.02100116 + objectReference: {fileID: 0} + - target: {fileID: 3015796629085603444, guid: 6f0f70ab322e39f4aa123adb2409d202, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 3015796629085603444, guid: 6f0f70ab322e39f4aa123adb2409d202, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -174.4 + objectReference: {fileID: 0} + - target: {fileID: 3015796629085603444, guid: 6f0f70ab322e39f4aa123adb2409d202, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 214.1 + objectReference: {fileID: 0} + - target: {fileID: 3337442696376404706, guid: 6f0f70ab322e39f4aa123adb2409d202, type: 3} + propertyPath: damagePerShot + value: 150 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 6f0f70ab322e39f4aa123adb2409d202, type: 3} +--- !u!1 &881192533 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 2490934396627426510, guid: 6f0f70ab322e39f4aa123adb2409d202, type: 3} + m_PrefabInstance: {fileID: 881192532} + m_PrefabAsset: {fileID: 0} --- !u!1 &888918216 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Weapons/Sword2.cs b/Assets/Scripts/Weapons/Sword2.cs index ea913893561ecfe36b0bc079893d956eecf0fe0e..6e72d2a93eb0bae5afdfb77e116d1b2701f38009 100644 --- a/Assets/Scripts/Weapons/Sword2.cs +++ b/Assets/Scripts/Weapons/Sword2.cs @@ -63,11 +63,8 @@ public class Sword2 : MonoBehaviour { if (other.gameObject.tag == "Enemy") { - EnemyHealth enemyHealth = other.gameObject.GetComponent<EnemyHealth>(); - if (enemyHealth != null) - { - enemyHealth.TakeDamage(damagePerShot); - } + Debug.Log("Hit enemy"); + other.GetComponent<EnemyHealth>().TakeDamage(damagePerShot, transform.position); } } }