From 04352f3344955c27027f350bcaa94003df00b160 Mon Sep 17 00:00:00 2001 From: soulsyrup <121889618+soulsyrup@users.noreply.github.com> Date: Sat, 20 Jan 2024 13:33:04 -0300 Subject: [PATCH] testing weapon pickup, weapon equip, enemyNPC attack, enemyNPC distance meter HUD --- .../Weapons/Ammunition/TestBullet.prefab | 170 ----- DarkFlow/Assets/Scenes/systemTest.unity | 674 ++++++++++++++++-- .../AI/{NPC_enemy1.meta => NPC_enemies.meta} | 0 .../AI/{NPC_enemy1 => NPC_enemies}/NPC.cs | 19 +- .../{NPC_enemy1 => NPC_enemies}/NPC.cs.meta | 0 .../bio_monster_squad_member.meta} | 5 +- .../BioMonsterSquadMemberEnemyNPC.cs | 22 + .../BioMonsterSquadMemberEnemyNPC.cs.meta} | 2 +- .../BioMonsterSquadMemberEnemyNPCHealth.cs | 34 + ...oMonsterSquadMemberEnemyNPCHealth.cs.meta} | 0 .../Scripts/AI/NPC_enemy1/EnemyHealth.cs | 36 - .../Assets/Scripts/WeaponSystem/AutoAim.cs | 66 ++ .../Scripts/WeaponSystem/AutoAim.cs.meta | 11 + .../Scripts/WeaponSystem/DistanceMeter.cs | 72 ++ .../WeaponSystem/DistanceMeter.cs.meta | 11 + .../Assets/Scripts/WeaponSystem/Inventory.cs | 36 + .../Scripts/WeaponSystem/Inventory.cs.meta | 11 + .../Assets/Scripts/WeaponSystem/Weapon.cs | 64 +- .../Scripts/WeaponSystem/WeaponPickup.cs | 35 + .../Scripts/WeaponSystem/WeaponPickup.cs.meta | 11 + .../Assets/Scripts/WeaponSystem/Weapons.meta | 8 + .../flesh_eating_nano_injection_gun.cs | 15 + .../flesh_eating_nano_injection_gun.cs.meta | 11 + .../Scripts/WeaponSystem/bulletWeapon.cs | 17 - 24 files changed, 994 insertions(+), 336 deletions(-) delete mode 100644 DarkFlow/Assets/Prefabs/Weapons/Ammunition/TestBullet.prefab rename DarkFlow/Assets/Scripts/AI/{NPC_enemy1.meta => NPC_enemies.meta} (100%) rename DarkFlow/Assets/Scripts/AI/{NPC_enemy1 => NPC_enemies}/NPC.cs (87%) rename DarkFlow/Assets/Scripts/AI/{NPC_enemy1 => NPC_enemies}/NPC.cs.meta (100%) rename DarkFlow/Assets/{Prefabs/Weapons/Ammunition/TestBullet.prefab.meta => Scripts/AI/NPC_enemies/bio_monster_squad_member.meta} (57%) create mode 100644 DarkFlow/Assets/Scripts/AI/NPC_enemies/bio_monster_squad_member/BioMonsterSquadMemberEnemyNPC.cs rename DarkFlow/Assets/Scripts/{WeaponSystem/bulletWeapon.cs.meta => AI/NPC_enemies/bio_monster_squad_member/BioMonsterSquadMemberEnemyNPC.cs.meta} (83%) create mode 100644 DarkFlow/Assets/Scripts/AI/NPC_enemies/bio_monster_squad_member/BioMonsterSquadMemberEnemyNPCHealth.cs rename DarkFlow/Assets/Scripts/AI/{NPC_enemy1/EnemyHealth.cs.meta => NPC_enemies/bio_monster_squad_member/BioMonsterSquadMemberEnemyNPCHealth.cs.meta} (100%) delete mode 100644 DarkFlow/Assets/Scripts/AI/NPC_enemy1/EnemyHealth.cs create mode 100644 DarkFlow/Assets/Scripts/WeaponSystem/AutoAim.cs create mode 100644 DarkFlow/Assets/Scripts/WeaponSystem/AutoAim.cs.meta create mode 100644 DarkFlow/Assets/Scripts/WeaponSystem/DistanceMeter.cs create mode 100644 DarkFlow/Assets/Scripts/WeaponSystem/DistanceMeter.cs.meta create mode 100644 DarkFlow/Assets/Scripts/WeaponSystem/Inventory.cs create mode 100644 DarkFlow/Assets/Scripts/WeaponSystem/Inventory.cs.meta create mode 100644 DarkFlow/Assets/Scripts/WeaponSystem/WeaponPickup.cs create mode 100644 DarkFlow/Assets/Scripts/WeaponSystem/WeaponPickup.cs.meta create mode 100644 DarkFlow/Assets/Scripts/WeaponSystem/Weapons.meta create mode 100644 DarkFlow/Assets/Scripts/WeaponSystem/Weapons/flesh_eating_nano_injection_gun.cs create mode 100644 DarkFlow/Assets/Scripts/WeaponSystem/Weapons/flesh_eating_nano_injection_gun.cs.meta delete mode 100644 DarkFlow/Assets/Scripts/WeaponSystem/bulletWeapon.cs diff --git a/DarkFlow/Assets/Prefabs/Weapons/Ammunition/TestBullet.prefab b/DarkFlow/Assets/Prefabs/Weapons/Ammunition/TestBullet.prefab deleted file mode 100644 index 2e41aff..0000000 --- a/DarkFlow/Assets/Prefabs/Weapons/Ammunition/TestBullet.prefab +++ /dev/null @@ -1,170 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1 &8349831137147255041 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1726977606106222932} - - component: {fileID: 7812167439409084440} - - component: {fileID: 1379512933160070709} - - component: {fileID: 1684956072567834962} - - component: {fileID: 2861036403378897309} - - component: {fileID: 6631707359171338886} - - component: {fileID: -9142401622206200639} - m_Layer: 0 - m_Name: TestBullet - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &1726977606106222932 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8349831137147255041} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 23.668, y: 1.638, z: 21.378} - m_LocalScale: {x: 0.09, y: 0.09, z: 0.09} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!33 &7812167439409084440 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8349831137147255041} - m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} ---- !u!23 &1379512933160070709 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8349831137147255041} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_StaticShadowCaster: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 2 - m_RayTraceProcedural: 0 - m_RenderingLayerMask: 1 - m_RendererPriority: 0 - m_Materials: - - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_ReceiveGI: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 1 - 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 - m_AdditionalVertexStreams: {fileID: 0} ---- !u!135 &1684956072567834962 -SphereCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8349831137147255041} - m_Material: {fileID: 0} - m_IncludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ExcludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_LayerOverridePriority: 0 - m_IsTrigger: 0 - m_ProvidesContacts: 1 - m_Enabled: 1 - serializedVersion: 3 - m_Radius: 0.5 - m_Center: {x: 0, y: 0, z: 0} ---- !u!114 &2861036403378897309 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8349831137147255041} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} - m_Name: - m_EditorClassIdentifier: - GlobalObjectIdHash: 3307552005 - AlwaysReplicateAsRoot: 0 - SynchronizeTransform: 1 - ActiveSceneSynchronization: 0 - SceneMigrationSynchronization: 1 - SpawnWithObservers: 1 - DontDestroyWithOwner: 0 - AutoObjectParentSync: 1 ---- !u!114 &6631707359171338886 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8349831137147255041} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 93157781bc925fa47b169261fdf3a287, type: 3} - m_Name: - m_EditorClassIdentifier: - explodeOnContact: 0 ---- !u!54 &-9142401622206200639 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 8349831137147255041} - serializedVersion: 4 - m_Mass: 1 - m_Drag: 0 - m_AngularDrag: 0.05 - m_CenterOfMass: {x: 0, y: 0, z: 0} - m_InertiaTensor: {x: 1, y: 1, z: 1} - m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1} - m_IncludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ExcludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ImplicitCom: 1 - m_ImplicitTensor: 1 - m_UseGravity: 1 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 0 - m_CollisionDetection: 0 diff --git a/DarkFlow/Assets/Scenes/systemTest.unity b/DarkFlow/Assets/Scenes/systemTest.unity index 121fa19..1a64a32 100644 --- a/DarkFlow/Assets/Scenes/systemTest.unity +++ b/DarkFlow/Assets/Scenes/systemTest.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_IndirectSpecularColor: {r: 0.118667774, g: 0.121850684, b: 0.104419984, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -224,13 +224,13 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 247699059} serializedVersion: 2 - m_LocalRotation: {x: 0.26150537, y: -0.73251665, z: 0.49565357, w: 0.3864736} - m_LocalPosition: {x: 0, y: 0.929, z: 0} + m_LocalRotation: {x: 0.23295103, y: -0.76635665, z: 0.44153214, w: 0.40432748} + m_LocalPosition: {x: -0.51, y: 0.46, z: -0.35} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 1335048396} - m_LocalEulerAnglesHint: {x: 68.168, y: -124.368, z: 0} + m_LocalEulerAnglesHint: {x: 59.896, y: -124.368, z: 0} --- !u!114 &247699061 MonoBehaviour: m_ObjectHideFlags: 0 @@ -267,9 +267,9 @@ Light: m_Shape: 0 m_Color: {r: 0.85950917, g: 0.10176105, b: 0.10176105, a: 1} m_Intensity: 36.25 - m_Range: 10 - m_SpotAngle: 115.374054 - m_InnerSpotAngle: 37.82803 + m_Range: 100 + m_SpotAngle: 160.92133 + m_InnerSpotAngle: 83.375244 m_CookieSize: 10 m_Shadows: m_Type: 0 @@ -973,6 +973,91 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 557912912} m_CullTransparentMesh: 1 +--- !u!1001 &703716771 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: -8679921383154817045, guid: a65433442e687234ab8043c546677d72, + type: 3} + propertyPath: m_LocalPosition.x + value: -1.8 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: a65433442e687234ab8043c546677d72, + type: 3} + propertyPath: m_LocalPosition.y + value: 0.013 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: a65433442e687234ab8043c546677d72, + type: 3} + propertyPath: m_LocalPosition.z + value: 8.429001 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: a65433442e687234ab8043c546677d72, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: a65433442e687234ab8043c546677d72, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: a65433442e687234ab8043c546677d72, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: a65433442e687234ab8043c546677d72, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: a65433442e687234ab8043c546677d72, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: a65433442e687234ab8043c546677d72, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -8679921383154817045, guid: a65433442e687234ab8043c546677d72, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 919132149155446097, guid: a65433442e687234ab8043c546677d72, + type: 3} + propertyPath: m_Name + value: Mutant@Hard Landing + objectReference: {fileID: 0} + - target: {fileID: 919132149155446097, guid: a65433442e687234ab8043c546677d72, + type: 3} + propertyPath: m_TagString + value: NPC + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: a65433442e687234ab8043c546677d72, + type: 3} + insertIndex: -1 + addedObject: {fileID: 1749922643} + - targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: a65433442e687234ab8043c546677d72, + type: 3} + insertIndex: -1 + addedObject: {fileID: 1749922642} + - targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: a65433442e687234ab8043c546677d72, + type: 3} + insertIndex: -1 + addedObject: {fileID: 1749922641} + m_SourcePrefab: {fileID: 100100000, guid: a65433442e687234ab8043c546677d72, type: 3} --- !u!1001 &734538055 PrefabInstance: m_ObjectHideFlags: 0 @@ -1054,7 +1139,15 @@ PrefabInstance: m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] - m_AddedComponents: [] + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: 52746a891a56fd93e9f7dbfd6a761363, + type: 3} + insertIndex: -1 + addedObject: {fileID: 1504868802} + - targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: 52746a891a56fd93e9f7dbfd6a761363, + type: 3} + insertIndex: -1 + addedObject: {fileID: 1504868803} m_SourcePrefab: {fileID: 100100000, guid: 52746a891a56fd93e9f7dbfd6a761363, type: 3} --- !u!1 &777093949 GameObject: @@ -1131,6 +1224,126 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 777093949} m_CullTransparentMesh: 1 +--- !u!1 &797080031 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 797080032} + m_Layer: 3 + m_Name: WeaponAttachmentPoint + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &797080032 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 797080031} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.54, y: 1.21, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 797374913} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &797374912 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 4663426026667250098, guid: 301cebf8eacff4b4a83bf8f95afafb31, + type: 3} + m_PrefabInstance: {fileID: 859859904} + m_PrefabAsset: {fileID: 0} +--- !u!4 &797374913 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 5475253377034111752, guid: 301cebf8eacff4b4a83bf8f95afafb31, + type: 3} + m_PrefabInstance: {fileID: 859859904} + m_PrefabAsset: {fileID: 0} +--- !u!136 &797374919 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 797374912} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 1 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 1 + m_Height: 1 + m_Direction: 1 + m_Center: {x: 0, y: 0.42, z: -0} +--- !u!114 &797374920 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 797374912} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 61a529ea00708ce4b8ebac388db9a581, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &797374921 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 797374912} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0977348939a5d975d995ed1b2fb1ff30, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &797374922 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 797374912} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5a24e08f546f05078908af1a2a3a3adc, type: 3} + m_Name: + m_EditorClassIdentifier: + target: {fileID: 0} + aimAssistRadius: 10 + enemyLayer: + serializedVersion: 2 + m_Bits: 0 + rotationSpeed: 5 +--- !u!114 &797374923 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 797374912} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4614fae776190dd76a98c3293f3e3ce5, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1001 &859859904 PrefabInstance: m_ObjectHideFlags: 0 @@ -1251,8 +1464,32 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: 5475253377034111752, guid: 301cebf8eacff4b4a83bf8f95afafb31, + type: 3} + insertIndex: -1 + addedObject: {fileID: 797080032} + m_AddedComponents: + - targetCorrespondingSourceObject: {fileID: 4663426026667250098, guid: 301cebf8eacff4b4a83bf8f95afafb31, + type: 3} + insertIndex: -1 + addedObject: {fileID: 797374919} + - targetCorrespondingSourceObject: {fileID: 4663426026667250098, guid: 301cebf8eacff4b4a83bf8f95afafb31, + type: 3} + insertIndex: -1 + addedObject: {fileID: 797374920} + - targetCorrespondingSourceObject: {fileID: 4663426026667250098, guid: 301cebf8eacff4b4a83bf8f95afafb31, + type: 3} + insertIndex: -1 + addedObject: {fileID: 797374923} + - targetCorrespondingSourceObject: {fileID: 4663426026667250098, guid: 301cebf8eacff4b4a83bf8f95afafb31, + type: 3} + insertIndex: -1 + addedObject: {fileID: 797374922} + - targetCorrespondingSourceObject: {fileID: 4663426026667250098, guid: 301cebf8eacff4b4a83bf8f95afafb31, + type: 3} + insertIndex: -1 + addedObject: {fileID: 797374921} m_SourcePrefab: {fileID: 100100000, guid: 301cebf8eacff4b4a83bf8f95afafb31, type: 3} --- !u!1 &886908877 GameObject: @@ -1365,6 +1602,140 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &1008518580 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1008518581} + - component: {fileID: 1008518583} + - component: {fileID: 1008518582} + m_Layer: 5 + m_Name: Text (TMP) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1008518581 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1008518580} + 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_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1456794522} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 30, y: 30} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1008518582 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1008518580} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: 0.0 + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 10 + m_fontSizeBase: 10 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 8 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &1008518583 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1008518580} + m_CullTransparentMesh: 1 --- !u!1 &1029546730 GameObject: m_ObjectHideFlags: 0 @@ -1398,27 +1769,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} m_Name: m_EditorClassIdentifier: - GlobalObjectIdHash: 3209195208 - NetworkManagerOwner: {fileID: 0} - k__BackingField: 0 - k__BackingField: 0 - AlwaysReplicateAsRoot: 0 - k__BackingField: 0 - SynchronizeTransform: 1 - k__BackingField: 0 - k__BackingField: 0 - ActiveSceneSynchronization: 0 - SceneMigrationSynchronization: 1 - SpawnWithObservers: 1 - DontDestroyWithOwner: 0 - AutoObjectParentSync: 1 - SceneOriginHandle: 0 - NetworkSceneHandle: 0 - m_SceneOrigin: - m_Handle: 0 - m_CachedParent: {fileID: 0} - m_CachedWorldPositionStays: 1 - m_ChildNetworkBehaviours: [] --- !u!114 &1029546732 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1450,6 +1800,11 @@ MonoBehaviour: weaponCostQuint: 0 smg1AmmoCount: 30 smg1RoundDamage: 10 + raycastDistance: 100 + hitLayer: + serializedVersion: 2 + m_Bits: 0 + enemyHealth: {fileID: 0} --- !u!65 &1029546733 BoxCollider: m_ObjectHideFlags: 0 @@ -2039,8 +2394,127 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 247699060} + - {fileID: 1355915662} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1355915661 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1355915662} + - component: {fileID: 1355915664} + - component: {fileID: 1355915663} + m_Layer: 0 + m_Name: Spot Light (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1355915662 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1355915661} + serializedVersion: 2 + m_LocalRotation: {x: 0.3290435, y: -0.6945743, z: 0.5326234, w: 0.3544141} + m_LocalPosition: {x: 0.85, y: 2.71, z: 1.09} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1335048396} + m_LocalEulerAnglesHint: {x: 76.687, y: -141.982, z: -20.211} +--- !u!114 &1355915663 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1355915661} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Version: 3 + m_UsePipelineSettings: 1 + m_AdditionalLightsShadowResolutionTier: 2 + m_LightLayerMask: 1 + m_RenderingLayers: 1 + m_CustomShadowLayers: 0 + m_ShadowLayerMask: 1 + m_ShadowRenderingLayers: 1 + m_LightCookieSize: {x: 1, y: 1} + m_LightCookieOffset: {x: 0, y: 0} + m_SoftShadowQuality: 0 +--- !u!108 &1355915664 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1355915661} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 0 + m_Shape: 0 + m_Color: {r: 0.85950917, g: 0.10176105, b: 0.10176105, a: 1} + m_Intensity: 1000 + m_Range: 100 + m_SpotAngle: 179 + m_InnerSpotAngle: 101.453995 + m_CookieSize: 10 + m_Shadows: + m_Type: 0 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 --- !u!1 &1417833599 GameObject: m_ObjectHideFlags: 0 @@ -2251,6 +2725,11 @@ MonoBehaviour: weaponCostQuint: 0 smg1AmmoCount: 30 smg1RoundDamage: 10 + raycastDistance: 100 + hitLayer: + serializedVersion: 2 + m_Bits: 0 + enemyHealth: {fileID: 0} --- !u!114 &1448541920 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2263,27 +2742,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: d5a57f767e5e46a458fc5d3c628d0cbb, type: 3} m_Name: m_EditorClassIdentifier: - GlobalObjectIdHash: 922951363 - NetworkManagerOwner: {fileID: 0} - k__BackingField: 0 - k__BackingField: 0 - AlwaysReplicateAsRoot: 0 - k__BackingField: 0 - SynchronizeTransform: 1 - k__BackingField: 0 - k__BackingField: 0 - ActiveSceneSynchronization: 0 - SceneMigrationSynchronization: 1 - SpawnWithObservers: 1 - DontDestroyWithOwner: 0 - AutoObjectParentSync: 1 - SceneOriginHandle: 0 - NetworkSceneHandle: 0 - m_SceneOrigin: - m_Handle: 0 - m_CachedParent: {fileID: 0} - m_CachedWorldPositionStays: 1 - m_ChildNetworkBehaviours: [] --- !u!65 &1448541921 BoxCollider: m_ObjectHideFlags: 0 @@ -2449,7 +2907,7 @@ Canvas: m_OverridePixelPerfect: 0 m_SortingBucketNormalizedSize: 0 m_VertexColorAlwaysGammaSpace: 0 - m_AdditionalShaderChannelsFlag: 0 + m_AdditionalShaderChannelsFlag: 25 m_UpdateRectTransformForStandalone: 0 m_SortingLayerID: 0 m_SortingOrder: 0 @@ -2467,6 +2925,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 952038283} + - {fileID: 1008518581} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -2657,6 +3116,46 @@ MonoBehaviour: CameraRadius: 0.2 DampingIntoCollision: 0 DampingFromCollision: 2 +--- !u!1 &1504868800 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: 52746a891a56fd93e9f7dbfd6a761363, + type: 3} + m_PrefabInstance: {fileID: 734538055} + m_PrefabAsset: {fileID: 0} +--- !u!65 &1504868802 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1504868800} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 1 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 0.06, y: 0.05, z: 0.05} + m_Center: {x: 0, y: 0.05, z: 0} +--- !u!114 &1504868803 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1504868800} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c9a692ecc29b2f2fb93961b33a14550a, type: 3} + m_Name: + m_EditorClassIdentifier: + weaponPrefab: {fileID: 1504868800} --- !u!1 &1694516136 GameObject: m_ObjectHideFlags: 0 @@ -2698,6 +3197,64 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &1749922638 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: a65433442e687234ab8043c546677d72, + type: 3} + m_PrefabInstance: {fileID: 703716771} + m_PrefabAsset: {fileID: 0} +--- !u!65 &1749922641 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1749922638} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 1 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Size: {x: 0.57, y: 1.67, z: 0.73} + m_Center: {x: -0.01, y: 0.85, z: 0.04} +--- !u!33 &1749922642 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1749922638} + m_Mesh: {fileID: -4407679230795050791, guid: a65433442e687234ab8043c546677d72, type: 3} +--- !u!136 &1749922643 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1749922638} + m_Material: {fileID: 0} + m_IncludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_ExcludeLayers: + serializedVersion: 2 + m_Bits: 0 + m_LayerOverridePriority: 0 + m_IsTrigger: 0 + m_ProvidesContacts: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0.01, y: 1.02, z: 0.09} --- !u!1 &1804378826 GameObject: m_ObjectHideFlags: 0 @@ -3164,8 +3721,8 @@ Light: serializedVersion: 10 m_Type: 1 m_Shape: 0 - m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} - m_Intensity: 1 + m_Color: {r: 0.72418785, g: 0.45316476, b: 0.1522947, a: 1} + m_Intensity: 0.01 m_Range: 10 m_SpotAngle: 30 m_InnerSpotAngle: 21.80208 @@ -3223,13 +3780,13 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1973752562} serializedVersion: 2 - m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} - m_LocalPosition: {x: 10.61, y: 28.28, z: -18.38} + m_LocalRotation: {x: -0.671237, y: 0.7219954, z: 0.12039416, w: -0.116913654} + m_LocalPosition: {x: -229, y: 430, z: 396} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} + m_LocalEulerAnglesHint: {x: -0.968, y: 199.299, z: -85.992} --- !u!114 &1973752565 MonoBehaviour: m_ObjectHideFlags: 0 @@ -3264,6 +3821,7 @@ SceneRoots: - {fileID: 1029546736} - {fileID: 1417833605} - {fileID: 518869419} + - {fileID: 703716771} - {fileID: 1448541924} - {fileID: 1456794522} - {fileID: 1335048396} diff --git a/DarkFlow/Assets/Scripts/AI/NPC_enemy1.meta b/DarkFlow/Assets/Scripts/AI/NPC_enemies.meta similarity index 100% rename from DarkFlow/Assets/Scripts/AI/NPC_enemy1.meta rename to DarkFlow/Assets/Scripts/AI/NPC_enemies.meta diff --git a/DarkFlow/Assets/Scripts/AI/NPC_enemy1/NPC.cs b/DarkFlow/Assets/Scripts/AI/NPC_enemies/NPC.cs similarity index 87% rename from DarkFlow/Assets/Scripts/AI/NPC_enemy1/NPC.cs rename to DarkFlow/Assets/Scripts/AI/NPC_enemies/NPC.cs index 49acee4..50edfed 100644 --- a/DarkFlow/Assets/Scripts/AI/NPC_enemy1/NPC.cs +++ b/DarkFlow/Assets/Scripts/AI/NPC_enemies/NPC.cs @@ -1,16 +1,11 @@ using System.Collections; -using System.Collections.Generic; -using Unity.VisualScripting; using UnityEngine; -using UnityEngine.UI; -using UnityEngine.UIElements; using UnityEngine.InputSystem; using TMPro; + public class NPC : MonoBehaviour { - [Header("NPC")] - [Space] [SerializeField] private string npcName; // NPC will get their name - GameObject will not carry NPC's exact name. [SerializeField] private string desc; // NPC description - This is their 'Inspect' or 'Examine' text. [Space] @@ -29,7 +24,6 @@ public class NPC : MonoBehaviour private bool canTalk = false; - private void Start() { npcNameBox.text = ""; @@ -42,7 +36,7 @@ private void Start() private void Update() { - if (Input.GetKeyDown(KeyCode.F)) + if (Keyboard.current.fKey.wasPressedThisFrame) { OnTalk(); } @@ -50,7 +44,7 @@ private void Update() private void OnTriggerEnter(Collider other) { - if(other.CompareTag("Player")) + if (other.CompareTag("Player")) { canTalk = true; } @@ -66,8 +60,9 @@ private void OnTriggerExit(Collider other) private void OnDeath() { var dItem = Instantiate(dropOnDeath); - dItem.transform.position = this.transform.position; + dItem.transform.position = transform.position; } + private void OnTalk() { if (canTalk) @@ -76,8 +71,4 @@ private void OnTalk() npcChatBox.text = NPCText; } } - - - } - diff --git a/DarkFlow/Assets/Scripts/AI/NPC_enemy1/NPC.cs.meta b/DarkFlow/Assets/Scripts/AI/NPC_enemies/NPC.cs.meta similarity index 100% rename from DarkFlow/Assets/Scripts/AI/NPC_enemy1/NPC.cs.meta rename to DarkFlow/Assets/Scripts/AI/NPC_enemies/NPC.cs.meta diff --git a/DarkFlow/Assets/Prefabs/Weapons/Ammunition/TestBullet.prefab.meta b/DarkFlow/Assets/Scripts/AI/NPC_enemies/bio_monster_squad_member.meta similarity index 57% rename from DarkFlow/Assets/Prefabs/Weapons/Ammunition/TestBullet.prefab.meta rename to DarkFlow/Assets/Scripts/AI/NPC_enemies/bio_monster_squad_member.meta index 513528e..5eccc17 100644 --- a/DarkFlow/Assets/Prefabs/Weapons/Ammunition/TestBullet.prefab.meta +++ b/DarkFlow/Assets/Scripts/AI/NPC_enemies/bio_monster_squad_member.meta @@ -1,6 +1,7 @@ fileFormatVersion: 2 -guid: 4aaa6a671a394f54587a9161fe5ac8c9 -PrefabImporter: +guid: e4dcaa3802d1743549e48d79bbcc7f81 +folderAsset: yes +DefaultImporter: externalObjects: {} userData: assetBundleName: diff --git a/DarkFlow/Assets/Scripts/AI/NPC_enemies/bio_monster_squad_member/BioMonsterSquadMemberEnemyNPC.cs b/DarkFlow/Assets/Scripts/AI/NPC_enemies/bio_monster_squad_member/BioMonsterSquadMemberEnemyNPC.cs new file mode 100644 index 0000000..d4e1ef4 --- /dev/null +++ b/DarkFlow/Assets/Scripts/AI/NPC_enemies/bio_monster_squad_member/BioMonsterSquadMemberEnemyNPC.cs @@ -0,0 +1,22 @@ +using UnityEngine; + +[CreateAssetMenu(fileName = "BioMonsterSquadMemberEnemyNPC", menuName = "NPCs/BioMonsterSquadMemberEnemyNPC", order = 1)] +public class BioMonsterSquadMemberEnemyNPC : ScriptableObject +{ + [Header("Bio Monster Squad Member Enemy NPC")] + [Space] + public string enemyName; // NPC's name + [TextArea(4, 10)] + public string enemyDescription; // NPC's description + public bool isHostile = true; // Whether this NPC is hostile + public string enemyDialogue; // Dialogue when interacting with the NPC + public GameObject dropOnDeath; // Item to drop when the NPC is defeated + public float detectionRadius = 10f; // Radius within which the enemy can detect the player + public float attackRange = 10f; // Range at which the enemy can start shooting + public float attackCooldown = 2f; // Cooldown between shots + public int damage = 10; // Damage inflicted by the enemy's shots + public GameObject bulletPrefab; // Prefab of the bullet to shoot + public float bulletSpeed = 10f; // Speed of the bullets + + // Add any other specific properties or behaviors for this enemy NPC here +} diff --git a/DarkFlow/Assets/Scripts/WeaponSystem/bulletWeapon.cs.meta b/DarkFlow/Assets/Scripts/AI/NPC_enemies/bio_monster_squad_member/BioMonsterSquadMemberEnemyNPC.cs.meta similarity index 83% rename from DarkFlow/Assets/Scripts/WeaponSystem/bulletWeapon.cs.meta rename to DarkFlow/Assets/Scripts/AI/NPC_enemies/bio_monster_squad_member/BioMonsterSquadMemberEnemyNPC.cs.meta index 88b41f2..e711f35 100644 --- a/DarkFlow/Assets/Scripts/WeaponSystem/bulletWeapon.cs.meta +++ b/DarkFlow/Assets/Scripts/AI/NPC_enemies/bio_monster_squad_member/BioMonsterSquadMemberEnemyNPC.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 93157781bc925fa47b169261fdf3a287 +guid: 33becd4d7cfa304008a934c073d1f2a5 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/DarkFlow/Assets/Scripts/AI/NPC_enemies/bio_monster_squad_member/BioMonsterSquadMemberEnemyNPCHealth.cs b/DarkFlow/Assets/Scripts/AI/NPC_enemies/bio_monster_squad_member/BioMonsterSquadMemberEnemyNPCHealth.cs new file mode 100644 index 0000000..2802203 --- /dev/null +++ b/DarkFlow/Assets/Scripts/AI/NPC_enemies/bio_monster_squad_member/BioMonsterSquadMemberEnemyNPCHealth.cs @@ -0,0 +1,34 @@ +using UnityEngine; + +[CreateAssetMenu(fileName = "BioMonsterSquadMemberEnemyNPCHealth", menuName = "Health/BioMonsterSquadMemberEnemyNPCHealth", order = 1)] +public class BioMonsterSquadMemberEnemyNPCHealth : ScriptableObject +{ + public int maxHealth = 100; // Maximum health points for this enemy type + public int currentHealth; // Current health of the enemy + + // Call this method to initialize the health when you spawn the enemy. + public void InitializeHealth() + { + currentHealth = maxHealth; + } + + // Method to take damage and update the current health. + public void TakeDamage(int damage) + { + currentHealth -= damage; + + if (currentHealth <= 0) + { + Die(); + } + } + + // Method to handle the enemy's death. + void Die() + { + // Here you can add the logic for the enemy's death, like playing an animation or dropping items. + // Actual destruction of the game object should be handled by the script that uses this ScriptableObject. + // For now, this method will simply log a message. + Debug.Log("BioMonsterSquadMemberEnemyNPC has died."); + } +} diff --git a/DarkFlow/Assets/Scripts/AI/NPC_enemy1/EnemyHealth.cs.meta b/DarkFlow/Assets/Scripts/AI/NPC_enemies/bio_monster_squad_member/BioMonsterSquadMemberEnemyNPCHealth.cs.meta similarity index 100% rename from DarkFlow/Assets/Scripts/AI/NPC_enemy1/EnemyHealth.cs.meta rename to DarkFlow/Assets/Scripts/AI/NPC_enemies/bio_monster_squad_member/BioMonsterSquadMemberEnemyNPCHealth.cs.meta diff --git a/DarkFlow/Assets/Scripts/AI/NPC_enemy1/EnemyHealth.cs b/DarkFlow/Assets/Scripts/AI/NPC_enemy1/EnemyHealth.cs deleted file mode 100644 index be53839..0000000 --- a/DarkFlow/Assets/Scripts/AI/NPC_enemy1/EnemyHealth.cs +++ /dev/null @@ -1,36 +0,0 @@ -using UnityEngine; - -// Create a ScriptableObject that represents the health of an enemy. -[CreateAssetMenu(fileName = "EnemyHealth", menuName = "Health/EnemyHealth", order = 1)] -public class EnemyHealth : ScriptableObject -{ - public int maxHealth = 5; // Health points, as per our requirement - public int currentHealth; - public GameObject Prefab; - - //public GameObject IntroPrefab => Prefab; - - // Call this method to initialize the health when you spawn the enemy. - public void OnEnable() - { - currentHealth = maxHealth; - } - - public void TakeDamage(int damage) - { - currentHealth -= damage; - - if (currentHealth <= 0) - { - Die(); - } - } - - void Die() - { - // Here we can add the logic for the enemy's death, like playing an animation. - // Actual destruction of the game object should be handled by the script that uses this ScriptableObject. - // For now, this method will simply log a message. - Debug.Log("Enemy has died."); - } -} diff --git a/DarkFlow/Assets/Scripts/WeaponSystem/AutoAim.cs b/DarkFlow/Assets/Scripts/WeaponSystem/AutoAim.cs new file mode 100644 index 0000000..62a98fe --- /dev/null +++ b/DarkFlow/Assets/Scripts/WeaponSystem/AutoAim.cs @@ -0,0 +1,66 @@ +using UnityEngine; + +public class AutoAim : MonoBehaviour +{ + public Transform target; // The current target + public float aimAssistRadius = 10f; // Radius within which to search for targets + public LayerMask enemyLayer; // Layer on which the enemies are placed + public float rotationSpeed = 5f; // Speed at which the weapon rotates towards the target + private DistanceMeter distanceMeter; // Reference to the DistanceMeter component + + private void Start() + { + // Find the DistanceMeter component in the scene + distanceMeter = FindObjectOfType(); + } + + private void Update() + { + if (target == null) // Find the closest target when there is none + { + FindClosestTarget(); + } + + if (target != null) + { + // Calculate the direction to the target + Vector3 directionToTarget = target.position - transform.position; + + // Calculate the rotation needed to aim at the target + Quaternion targetRotation = Quaternion.LookRotation(directionToTarget); + + // Smoothly rotate the weapon towards the target + transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, rotationSpeed * Time.deltaTime); + + // Calculate the distance to the target + float distance = Vector3.Distance(transform.position, target.position); + + // Call the UpdateDistance method in DistanceMeter to display the distance + distanceMeter.UpdateDistance(distance, target); + } + else + { + // If there's no target, hide the distance meter + distanceMeter.HideDistance(); + } + } + + private void FindClosestTarget() + { + Collider[] hits = Physics.OverlapSphere(transform.position, aimAssistRadius, enemyLayer); + float closestDistance = aimAssistRadius; + Transform closestTarget = null; + + foreach (var hit in hits) + { + float distance = Vector3.Distance(transform.position, hit.transform.position); + if (distance < closestDistance) + { + closestDistance = distance; + closestTarget = hit.transform; + } + } + + target = closestTarget; + } +} diff --git a/DarkFlow/Assets/Scripts/WeaponSystem/AutoAim.cs.meta b/DarkFlow/Assets/Scripts/WeaponSystem/AutoAim.cs.meta new file mode 100644 index 0000000..777cd85 --- /dev/null +++ b/DarkFlow/Assets/Scripts/WeaponSystem/AutoAim.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5a24e08f546f05078908af1a2a3a3adc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/DarkFlow/Assets/Scripts/WeaponSystem/DistanceMeter.cs b/DarkFlow/Assets/Scripts/WeaponSystem/DistanceMeter.cs new file mode 100644 index 0000000..9958c9f --- /dev/null +++ b/DarkFlow/Assets/Scripts/WeaponSystem/DistanceMeter.cs @@ -0,0 +1,72 @@ +using UnityEngine; +using UnityEngine.UI; +using TMPro; + +public class DistanceMeter : MonoBehaviour +{ + private GameObject meterObject; + private TextMeshProUGUI distanceText; + private Camera playerCamera; + private float offset = 50f; // Offset value to position the text to the right + + public void SetUp(GameObject prefab, Camera camera) + { + if (meterObject == null) + { + playerCamera = camera; + meterObject = Instantiate(prefab, transform); // Use the current object as the parent + distanceText = meterObject.GetComponent(); + distanceText.color = Color.red; // Set text color to red + } + } + + public void UpdateDistance(float distance, Transform enemyTransform) + { + if (meterObject != null) + { + Vector3 viewportPosition = playerCamera.WorldToViewportPoint(enemyTransform.position); + bool isEnemyOnScreen = viewportPosition.z > 0 && viewportPosition.x > 0 && viewportPosition.x < 1 && viewportPosition.y > 0 && viewportPosition.y < 1; + + if (isEnemyOnScreen) + { + Vector3 screenPos = playerCamera.WorldToScreenPoint(enemyTransform.position); + screenPos.x += offset; // Adjust the position to the right of the enemy + meterObject.transform.position = screenPos; + distanceText.text = $"{distance:0.0}m"; + meterObject.SetActive(true); + } + else + { + // Optional: Handle off-screen enemies by positioning the text at the edge of the screen + // or simply hide the text + meterObject.SetActive(false); // Hides the text for off-screen enemies + } + } + } + + public void HideDistance() + { + if (meterObject != null) + { + meterObject.SetActive(false); // Hide the text when there's no target + } + } + + private void Update() + { + if (meterObject != null) + { + // Ensure the meter always faces the camera + meterObject.transform.forward = playerCamera.transform.forward; + } + } + + private void OnDestroy() + { + // Clean up the UI element when the enemy is destroyed + if (meterObject != null) + { + Destroy(meterObject); + } + } +} diff --git a/DarkFlow/Assets/Scripts/WeaponSystem/DistanceMeter.cs.meta b/DarkFlow/Assets/Scripts/WeaponSystem/DistanceMeter.cs.meta new file mode 100644 index 0000000..73a9c67 --- /dev/null +++ b/DarkFlow/Assets/Scripts/WeaponSystem/DistanceMeter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0977348939a5d975d995ed1b2fb1ff30 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/DarkFlow/Assets/Scripts/WeaponSystem/Inventory.cs b/DarkFlow/Assets/Scripts/WeaponSystem/Inventory.cs new file mode 100644 index 0000000..ea79cef --- /dev/null +++ b/DarkFlow/Assets/Scripts/WeaponSystem/Inventory.cs @@ -0,0 +1,36 @@ +using UnityEngine; +using System.Collections.Generic; + +public class Inventory : MonoBehaviour +{ + private List weapons = new List(); + private int currentWeaponIndex = -1; + + public void AddWeapon(GameObject weaponPrefab) + { + GameObject weapon = Instantiate(weaponPrefab, transform.position, Quaternion.identity); + weapon.transform.SetParent(transform); // Set the player as the parent of the weapon + weapons.Add(weapon); + weapon.SetActive(false); // Start with the weapon inactive + } + + private void Update() + { + if (Input.GetKeyDown(KeyCode.R)) + { + EquipNextWeapon(); + } + } + + private void EquipNextWeapon() + { + if (weapons.Count == 0) + return; + + if (currentWeaponIndex != -1) + weapons[currentWeaponIndex].SetActive(false); + + currentWeaponIndex = (currentWeaponIndex + 1) % weapons.Count; + weapons[currentWeaponIndex].SetActive(true); + } +} diff --git a/DarkFlow/Assets/Scripts/WeaponSystem/Inventory.cs.meta b/DarkFlow/Assets/Scripts/WeaponSystem/Inventory.cs.meta new file mode 100644 index 0000000..367c716 --- /dev/null +++ b/DarkFlow/Assets/Scripts/WeaponSystem/Inventory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4614fae776190dd76a98c3293f3e3ce5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/DarkFlow/Assets/Scripts/WeaponSystem/Weapon.cs b/DarkFlow/Assets/Scripts/WeaponSystem/Weapon.cs index eee273d..b43b223 100644 --- a/DarkFlow/Assets/Scripts/WeaponSystem/Weapon.cs +++ b/DarkFlow/Assets/Scripts/WeaponSystem/Weapon.cs @@ -2,11 +2,8 @@ using UnityEngine; using UnityEngine.InputSystem; - -// This class is used to define weapons in the game. It includes properties for visual appearance, audio, and functionality. public class Weapon : MonoBehaviour { - // Enum for different types of weapons available in the game. public enum WeaponType { Knife, @@ -16,10 +13,9 @@ public enum WeaponType Shotgun, Rifle, RPG, - SMG1 // SMG1 added for submachine guns. + SMG1 } - // Enum for different types of ammo that might have different effects or damage. public enum AmmoType { Neurotech, @@ -31,55 +27,46 @@ public enum AmmoType Fuel } - // Dictionary to store base damage values for different ammo types. private Dictionary baseDamage = new Dictionary(); - // Public variables can be set in the editor to configure each weapon instance. public WeaponType weaponType; public AmmoType ammoType; [Header("Weapon Appearance")] - // Reference to the GameObject that represents the weapon in the game world. public GameObject weaponTransform; - // The icon that represents the weapon in UI. public Sprite weaponIcon; [Header("Weapon Identity")] - // The name and description for the weapon. public string weaponName; [TextArea(4, 10)] public string weaponDescription; - // The amount of damage this weapon does. public float weaponDamage; - // Rarity flag for special weapons. public bool isRareWeapon; [Header("Ammo")] - // The projectile prefab that this weapon fires. It must have the BulletWeapon script attached. public GameObject weaponProjectile; - // The point from which projectiles are fired. public Transform firePoint; - // The amount of ammo currently loaded in the weapon. public float ammoInWeapon; - // The amount of ammo the player is carrying. public float ammoCarried; [Header("Weapon Audio")] - // The audio source from which gun sounds are played. public AudioSource weaponAudioSource; - // Array of audio clips that can be played when the weapon is used. public AudioClip[] weaponSounds; [Header("Market")] - // The price of the weapon in-game currency if sold to an NPC. public float weaponCostQuint; [Header("SMG1 Specifics")] - // Specific properties for the SMG1 weapon type. public int smg1AmmoCount = 30; public int smg1RoundDamage = 10; - // At the start, initialize the ammo based on weapon type and set the damage for SMG1. + [Header("Linear Shooting")] + public float raycastDistance = 100f; + public LayerMask hitLayer; + + // Reference to the enemy's health scriptable object + public BioMonsterSquadMemberEnemyNPCHealth enemyHealth; + void Start() { InitializeAmmo(); @@ -90,27 +77,22 @@ void Start() } } - // Initializes base damage for each ammo type. void InitializeAmmo() { - // Base damages are set here but could be moved to an external configuration for easier balancing. baseDamage[AmmoType.Neurotech] = 1.5f; - // Other ammo types and their damages... + // Initialize other ammo types and their damages... } - // Update is called once per frame and listens for input to fire the weapon. void Update() { - if (Mouse.current.leftButton.wasPressedThisFrame && weaponProjectile) + if (Mouse.current.leftButton.wasPressedThisFrame) { PreFire(); } } - // PreFire checks if the weapon has ammo and then performs the shoot action. void PreFire() { - // If there is ammo in the weapon, shoot and play the corresponding sound. if (ammoInWeapon > 0) { ShootWeapon(); @@ -119,27 +101,33 @@ void PreFire() } else { - Debug.Log(weaponName + " has no ammo."); // Could be replaced with a UI message or sound. + Debug.Log(weaponName + " has no ammo."); } } - // Instantiates the projectile and applies force to it to simulate shooting. void ShootWeapon() { - // Instantiate the bullet and set its damage based on the weapon's damage. - var bullet = Instantiate(weaponProjectile, firePoint.position, firePoint.rotation); - var bulletScript = bullet.GetComponent(); - if (bulletScript != null) + Ray ray = Camera.main.ViewportPointToRay(new Vector3(0.5f, 0.5f, 0)); + RaycastHit hit; + + if (Physics.Raycast(ray, out hit, raycastDistance, hitLayer)) { - bulletScript.damage = smg1RoundDamage; + GameObject hitObject = hit.collider.gameObject; + + // Check if the hit object has an enemy health scriptable object + BioMonsterSquadMemberEnemyNPCHealth enemy = hitObject.GetComponent(); + if (enemy != null) + { + // Calculate damage based on the weapon and apply it to the enemy's health + enemy.TakeDamage((int)weaponDamage); + } } - bullet.GetComponent().AddForce(firePoint.forward * 10f, ForceMode.Impulse); + + // Play shooting animation or effects here. } - // Plays a random sound from the weaponSounds array. void PlayWeaponSound() { - // Randomly select a sound to play for variability. if (weaponSounds.Length > 0) { int randInt = Random.Range(0, weaponSounds.Length); diff --git a/DarkFlow/Assets/Scripts/WeaponSystem/WeaponPickup.cs b/DarkFlow/Assets/Scripts/WeaponSystem/WeaponPickup.cs new file mode 100644 index 0000000..8eda307 --- /dev/null +++ b/DarkFlow/Assets/Scripts/WeaponSystem/WeaponPickup.cs @@ -0,0 +1,35 @@ +using UnityEngine; + +public class WeaponPickup : MonoBehaviour +{ + public GameObject weaponPrefab; // Assign the weapon prefab in the inspector + private bool playerInRange = false; + private GameObject player; + + private void OnTriggerEnter(Collider other) + { + if (other.CompareTag("Player")) + { + playerInRange = true; + player = other.gameObject; + } + } + + private void OnTriggerExit(Collider other) + { + if (other.CompareTag("Player")) + { + playerInRange = false; + player = null; + } + } + + private void Update() + { + if (playerInRange && Input.GetKeyDown(KeyCode.E)) + { + player.GetComponent().AddWeapon(weaponPrefab); + Destroy(gameObject); // Destroy the pickup object + } + } +} diff --git a/DarkFlow/Assets/Scripts/WeaponSystem/WeaponPickup.cs.meta b/DarkFlow/Assets/Scripts/WeaponSystem/WeaponPickup.cs.meta new file mode 100644 index 0000000..9f843e3 --- /dev/null +++ b/DarkFlow/Assets/Scripts/WeaponSystem/WeaponPickup.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c9a692ecc29b2f2fb93961b33a14550a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/DarkFlow/Assets/Scripts/WeaponSystem/Weapons.meta b/DarkFlow/Assets/Scripts/WeaponSystem/Weapons.meta new file mode 100644 index 0000000..4036085 --- /dev/null +++ b/DarkFlow/Assets/Scripts/WeaponSystem/Weapons.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: aaa3f70cad178114fa398454ac97facd +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/DarkFlow/Assets/Scripts/WeaponSystem/Weapons/flesh_eating_nano_injection_gun.cs b/DarkFlow/Assets/Scripts/WeaponSystem/Weapons/flesh_eating_nano_injection_gun.cs new file mode 100644 index 0000000..6779a46 --- /dev/null +++ b/DarkFlow/Assets/Scripts/WeaponSystem/Weapons/flesh_eating_nano_injection_gun.cs @@ -0,0 +1,15 @@ +using UnityEngine; + +[CreateAssetMenu(fileName = "NanoInjectionGun", menuName = "Weapons/NanoInjectionGun")] +public class NanoInjectionGunAttributes : ScriptableObject +{ + [Header("Weapon Attributes")] + public string weaponName = "Flesh-Eating Nano-Injection Gun"; + [TextArea(4, 10)] + public string weaponDescription = "Injects nanobots that consume flesh from within, leaving the victim in agonizing pain as their body is slowly devoured."; + + public float damagePerShot = 10f; // Damage inflicted per shot + public float initialContinuousDamageRate = 2f; // Initial rate of continuous damage + public float damageIncreasePerShot = 1.5f; // Increase in damage rate per shot + public string ammunitionType = "Nanotech Ammunition"; +} diff --git a/DarkFlow/Assets/Scripts/WeaponSystem/Weapons/flesh_eating_nano_injection_gun.cs.meta b/DarkFlow/Assets/Scripts/WeaponSystem/Weapons/flesh_eating_nano_injection_gun.cs.meta new file mode 100644 index 0000000..d077edf --- /dev/null +++ b/DarkFlow/Assets/Scripts/WeaponSystem/Weapons/flesh_eating_nano_injection_gun.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 893cda35e22cb170db0b3ac604fec3e2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/DarkFlow/Assets/Scripts/WeaponSystem/bulletWeapon.cs b/DarkFlow/Assets/Scripts/WeaponSystem/bulletWeapon.cs deleted file mode 100644 index 3908982..0000000 --- a/DarkFlow/Assets/Scripts/WeaponSystem/bulletWeapon.cs +++ /dev/null @@ -1,17 +0,0 @@ -using UnityEngine; - - -public class bulletWeapon : MonoBehaviour -{ - public int damage; // Damage the bullet will apply - - void OnCollisionEnter(Collision collision) { - if (collision.transform.CompareTag("NPC")) { - var enemyHealth = collision.transform.GetComponent(); - if (enemyHealth != null) { - enemyHealth.TakeDamage(damage); - } - } - Destroy(gameObject); - } -}