From d27b860d7295ddd7a91cf1c01c586d10e224af94 Mon Sep 17 00:00:00 2001 From: "NBTEMP\\bib" Date: Thu, 20 Aug 2026 11:10:17 +0200 Subject: [PATCH] bullet --- Assets/Scenes/Story1.unity | 78 +++-------------------------------- Assets/Scripts/Bullet.cs | 2 +- Assets/Scripts/EnemyHealth.cs | 1 + Assets/Scripts/Shoot.cs | 9 ++-- 4 files changed, 12 insertions(+), 78 deletions(-) diff --git a/Assets/Scenes/Story1.unity b/Assets/Scenes/Story1.unity index 3e4bfc2..1f60ea3 100644 --- a/Assets/Scenes/Story1.unity +++ b/Assets/Scenes/Story1.unity @@ -194,62 +194,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 26477325} m_CullTransparentMesh: 1 ---- !u!1 &50826110 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 1804703078109025515, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} - m_PrefabInstance: {fileID: 104961602} - m_PrefabAsset: {fileID: 0} ---- !u!114 &50826113 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 50826110} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a10d4b5b33d924c428453e46c9513163, type: 3} - m_Name: - m_EditorClassIdentifier: Assembly-CSharp::Shoot - bulletPrefab: {fileID: 4474395191186681843, guid: afa71643f370d394e8dd19e0ab40ab57, type: 3} - spawnPointAR: {fileID: 2136079773} - spawnPointPistol: {fileID: 0} - AR: 1 - Pistole: 1 ---- !u!114 &50826114 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 50826110} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 57a6119ff88b0eb45940808859180edd, type: 3} - m_Name: - m_EditorClassIdentifier: Assembly-CSharp::EquipmentManager - AR: {fileID: 1546402525} - Pistole: {fileID: 3150477364047279588, guid: a0abf67d2f77de14aba69a9826c206df, type: 3} - Verband: {fileID: 0} - Knife: {fileID: 790623186319470878, guid: 3a2f64a76def43c41bb531d50c4a0696, type: 3} - ARisOn: 1 - PistoleIsOn: 1 - VerbandIsOn: 1 - KnifeIsOn: 1 ---- !u!114 &50826116 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 50826110} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: db77dcbb78925b543b84b7789c1903b9, type: 3} - m_Name: - m_EditorClassIdentifier: Assembly-CSharp::PlayerHealth - maxHealth: 100 - currentHealth: 100 --- !u!1001 &79145418 PrefabInstance: m_ObjectHideFlags: 0 @@ -334,6 +278,10 @@ PrefabInstance: propertyPath: m_Name value: PlayerRobot objectReference: {fileID: 0} + - target: {fileID: 3850558004095404047, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} + propertyPath: bulletPrefab + value: + objectReference: {fileID: 4474395191186681843, guid: afa71643f370d394e8dd19e0ab40ab57, type: 3} - target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} propertyPath: m_LocalScale.x value: 4 @@ -392,16 +340,7 @@ PrefabInstance: - targetCorrespondingSourceObject: {fileID: 3795091336040275115, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} insertIndex: -1 addedObject: {fileID: 1546402526} - m_AddedComponents: - - targetCorrespondingSourceObject: {fileID: 1804703078109025515, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} - insertIndex: -1 - addedObject: {fileID: 50826114} - - targetCorrespondingSourceObject: {fileID: 1804703078109025515, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} - insertIndex: -1 - addedObject: {fileID: 50826113} - - targetCorrespondingSourceObject: {fileID: 1804703078109025515, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} - insertIndex: -1 - addedObject: {fileID: 50826116} + m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3} --- !u!1 &347073536 GameObject: @@ -597,7 +536,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: Assembly-CSharp::HealthUI healthText: {fileID: 1240748855} - playerHealth: {fileID: 50826116} + playerHealth: {fileID: 0} --- !u!114 &535044339 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2089,11 +2028,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2046372891} m_CullTransparentMesh: 1 ---- !u!4 &2136079773 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 7448449092846401218, guid: 46014def5fa85504abb9cc3190ae45e3, type: 3} - m_PrefabInstance: {fileID: 79145418} - m_PrefabAsset: {fileID: 0} --- !u!1660057539 &9223372036854775807 SceneRoots: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Bullet.cs b/Assets/Scripts/Bullet.cs index 2b50131..07bd725 100644 --- a/Assets/Scripts/Bullet.cs +++ b/Assets/Scripts/Bullet.cs @@ -27,9 +27,9 @@ public class ARBullet : MonoBehaviour if (enemy != null) { enemy.TakeDamage(damage); - Destroy(gameObject); } + Destroy(gameObject); } else if(collision.gameObject.tag == "Wall") { diff --git a/Assets/Scripts/EnemyHealth.cs b/Assets/Scripts/EnemyHealth.cs index c2167b4..38b4c02 100644 --- a/Assets/Scripts/EnemyHealth.cs +++ b/Assets/Scripts/EnemyHealth.cs @@ -1,3 +1,4 @@ +//Oliver using UnityEngine; public class EnemyHealth : MonoBehaviour diff --git a/Assets/Scripts/Shoot.cs b/Assets/Scripts/Shoot.cs index c7107ac..4a46777 100644 --- a/Assets/Scripts/Shoot.cs +++ b/Assets/Scripts/Shoot.cs @@ -10,13 +10,13 @@ public class Shoot : MonoBehaviour [SerializeField] bool Pistole = true; void Start() { - + } void Update() { - - if ( AR == true && Input.GetKey(KeyCode.Mouse0)) + + if (AR == true && Input.GetKey(KeyCode.Mouse0)) { Shot(spawnPointAR); } @@ -28,7 +28,6 @@ public class Shoot : MonoBehaviour public void Shot(Transform spawnPoint) { GameObject bullet = Instantiate(bulletPrefab, spawnPoint.position, spawnPoint.rotation); - bullet.transform.Rotate(90,0,0); - Destroy(bullet, 2); + bullet.transform.Rotate(90, 0, 0); } }