# Conflicts:
#	Assets/Scenes/Story1.unity
#	Assets/Scripts/Shoot.cs
This commit is contained in:
2026-08-20 11:11:28 +02:00
9 changed files with 151 additions and 163 deletions
+10 -10
View File
@@ -1206,16 +1206,16 @@ MonoBehaviour:
m_MoveRepeatRate: 0.1
m_XRTrackingOrigin: {fileID: 0}
m_ActionsAsset: {fileID: -944628639613478452, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_PointAction: {fileID: -1654692200621890270, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_MoveAction: {fileID: -8784545083839296357, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_SubmitAction: {fileID: 392368643174621059, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_CancelAction: {fileID: 7727032971491509709, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_LeftClickAction: {fileID: 3001919216989983466, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_MiddleClickAction: {fileID: -2185481485913320682, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_RightClickAction: {fileID: -4090225696740746782, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_ScrollWheelAction: {fileID: 6240969308177333660, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_TrackedDevicePositionAction: {fileID: 6564999863303420839, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_TrackedDeviceOrientationAction: {fileID: 7970375526676320489, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_PointAction: {fileID: 1054132383583890850, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_MoveAction: {fileID: 3710738434707379630, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_SubmitAction: {fileID: 2064916234097673511, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_CancelAction: {fileID: -1967631576421560919, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_LeftClickAction: {fileID: 8056856818456041789, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_MiddleClickAction: {fileID: 3279352641294131588, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_RightClickAction: {fileID: 3837173908680883260, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_ScrollWheelAction: {fileID: 4502412055082496612, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_TrackedDevicePositionAction: {fileID: 4754684134866288074, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_TrackedDeviceOrientationAction: {fileID: 1025543830046995696, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_DeselectOnBackgroundClick: 1
m_PointerBehavior: 0
m_CursorLockBehavior: 0
+80 -33
View File
@@ -170,7 +170,7 @@ MonoBehaviour:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0.392}
m_RaycastTarget: 1
m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
@@ -194,6 +194,67 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 26477325}
m_CullTransparentMesh: 1
<<<<<<< HEAD
=======
--- !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}
weapon: {fileID: 1546402530}
fireRate: 0.15
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
>>>>>>> 85ece045864c59c50ed55097c35e2c15b9051a0f
--- !u!1001 &79145418
PrefabInstance:
m_ObjectHideFlags: 0
@@ -425,10 +486,10 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1985753437}
m_TargetAssemblyTypeName: PausenManager, Assembly-CSharp
m_MethodName: lobby
m_Mode: 5
- m_Target: {fileID: 535044339}
m_TargetAssemblyTypeName: PauseMenu, Assembly-CSharp
m_MethodName: ResumeGame
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
@@ -790,16 +851,16 @@ MonoBehaviour:
m_MoveRepeatRate: 0.1
m_XRTrackingOrigin: {fileID: 0}
m_ActionsAsset: {fileID: -944628639613478452, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_PointAction: {fileID: -1654692200621890270, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_MoveAction: {fileID: -8784545083839296357, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_SubmitAction: {fileID: 392368643174621059, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_CancelAction: {fileID: 7727032971491509709, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_LeftClickAction: {fileID: 3001919216989983466, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_MiddleClickAction: {fileID: -2185481485913320682, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_RightClickAction: {fileID: -4090225696740746782, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_ScrollWheelAction: {fileID: 6240969308177333660, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_TrackedDevicePositionAction: {fileID: 6564999863303420839, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_TrackedDeviceOrientationAction: {fileID: 7970375526676320489, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_PointAction: {fileID: 1054132383583890850, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_MoveAction: {fileID: 3710738434707379630, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_SubmitAction: {fileID: 2064916234097673511, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_CancelAction: {fileID: -1967631576421560919, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_LeftClickAction: {fileID: 8056856818456041789, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_MiddleClickAction: {fileID: 3279352641294131588, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_RightClickAction: {fileID: 3837173908680883260, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_ScrollWheelAction: {fileID: 4502412055082496612, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_TrackedDevicePositionAction: {fileID: 4754684134866288074, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_TrackedDeviceOrientationAction: {fileID: 1025543830046995696, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_DeselectOnBackgroundClick: 1
m_PointerBehavior: 0
m_CursorLockBehavior: 0
@@ -917,9 +978,9 @@ MonoBehaviour:
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1985753437}
m_TargetAssemblyTypeName: PausenManager, Assembly-CSharp
m_MethodName: Quit
- m_Target: {fileID: 535044339}
m_TargetAssemblyTypeName: PauseMenu, Assembly-CSharp
m_MethodName: QuitGame
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
@@ -1516,7 +1577,7 @@ RectTransform:
m_GameObject: {fileID: 1597635426}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1783601023}
@@ -1793,7 +1854,6 @@ GameObject:
- component: {fileID: 1985753435}
- component: {fileID: 1985753434}
- component: {fileID: 1985753433}
- component: {fileID: 1985753437}
m_Layer: 5
m_Name: "pausenmen\xFC"
m_TagString: Untagged
@@ -1887,19 +1947,6 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!114 &1985753437
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1985753432}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 33345f0f372370e4d903e361cc6ec87c, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::PausenManager
pauseMenuUI: {fileID: 0}
--- !u!1 &2041741097
GameObject:
m_ObjectHideFlags: 0
+1 -96
View File
@@ -119,11 +119,6 @@ NavMeshSettings:
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!20 &112919646 stripped
Camera:
m_CorrespondingSourceObject: {fileID: 9017485172064717998, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3}
m_PrefabInstance: {fileID: 1229760994}
m_PrefabAsset: {fileID: 0}
--- !u!1 &718992221
GameObject:
m_ObjectHideFlags: 0
@@ -237,95 +232,6 @@ Transform:
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1229760994
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1804703078109025515, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3}
propertyPath: m_Name
value: PlayerRobot
objectReference: {fileID: 0}
- target: {fileID: 2563429732134213952, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3}
propertyPath: PlayerCamera
value:
objectReference: {fileID: 112919646}
- target: {fileID: 2563429732134213952, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3}
propertyPath: Items.Array.size
value: 3
objectReference: {fileID: 0}
- target: {fileID: 2563429732134213952, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3}
propertyPath: 'Items.Array.data[0]'
value:
objectReference: {fileID: 5850548977863442861, guid: 46014def5fa85504abb9cc3190ae45e3, type: 3}
- target: {fileID: 2563429732134213952, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3}
propertyPath: 'Items.Array.data[1]'
value:
objectReference: {fileID: 3150477364047279588, guid: a0abf67d2f77de14aba69a9826c206df, type: 3}
- target: {fileID: 2563429732134213952, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3}
propertyPath: 'Items.Array.data[2]'
value:
objectReference: {fileID: 790623186319470878, guid: 3a2f64a76def43c41bb531d50c4a0696, type: 3}
- target: {fileID: 3795091336040275115, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3}
propertyPath: m_LocalPosition.x
value: -0.0318
objectReference: {fileID: 0}
- target: {fileID: 3795091336040275115, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3795091336040275115, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3}
propertyPath: m_LocalPosition.z
value: 0.0242
objectReference: {fileID: 0}
- target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3}
propertyPath: m_LocalPosition.x
value: 66.14095
objectReference: {fileID: 0}
- target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3}
propertyPath: m_LocalPosition.y
value: 0.2199987
objectReference: {fileID: 0}
- target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3}
propertyPath: m_LocalPosition.z
value: 43.59534
objectReference: {fileID: 0}
- target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7736108665850884707, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 6ea5f5e913c0b774fbcc2503ce1f5351, type: 3}
--- !u!1 &1585096096
GameObject:
m_ObjectHideFlags: 0
@@ -412,7 +318,7 @@ Transform:
m_GameObject: {fileID: 1585096096}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 55.13, y: 9.57, z: 49.51}
m_LocalPosition: {x: 55.13, y: 9.57, z: 247.9}
m_LocalScale: {x: 10, y: 18.479692, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
@@ -702,4 +608,3 @@ SceneRoots:
- {fileID: 1734103110}
- {fileID: 718992225}
- {fileID: 1585096100}
- {fileID: 1229760994}
+2
View File
@@ -26,6 +26,8 @@ public class Door_Rotate : MonoBehaviour
void Update()
{
if (PauseMenu.GameIsPaused) return;
if (Input.GetKeyDown(KeyCode.E) && IsPlayerLooking())
{
ToggleDoor();
+2
View File
@@ -19,6 +19,8 @@ public class EquipmentManager : MonoBehaviour
// Update is called once per frame
void Update()
{
if (PauseMenu.GameIsPaused) return;
if(Input.GetKeyDown(KeyCode.Alpha2) && PistoleIsOn == false)
{
AR.SetActive(false);
+19 -4
View File
@@ -6,14 +6,19 @@ public class PauseMenu : MonoBehaviour
public GameObject pauseMenuUI; // Das Pausenmenü-Panel
public GameObject hudUI; // Die Lebens- und Munitionsanzeige (HUD)
private bool isPaused = false;
public static bool GameIsPaused = false;
void Start()
{
ResumeGame();
}
void Update()
{
// Überprüft, ob die ESC-Taste gedrückt wurde
if (Input.GetKeyDown(KeyCode.Escape))
{
if (isPaused)
if (GameIsPaused)
{
ResumeGame();
}
@@ -29,7 +34,7 @@ public class PauseMenu : MonoBehaviour
pauseMenuUI.SetActive(true); // Pausenmenü anzeigen
hudUI.SetActive(false); // Lebens- & Munitionsanzeige ausblenden
Time.timeScale = 0f; // Spielzeit anhalten
isPaused = true;
GameIsPaused = true;
// MAUSZEIGER FREIGEBEN (damit man Knöpfe drücken kann)
Cursor.lockState = CursorLockMode.None;
@@ -41,10 +46,20 @@ public class PauseMenu : MonoBehaviour
pauseMenuUI.SetActive(false); // Pausenmenü ausblenden
hudUI.SetActive(true); // Lebens- & Munitionsanzeige wieder anzeigen
Time.timeScale = 1f; // Spielzeit weiterlaufen lassen
isPaused = false;
GameIsPaused = false;
// MAUSZEIGER WIEDER SPERREN (fürs Gameplay)
Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
}
public void QuitGame()
{
Time.timeScale = 1f;
#if UNITY_EDITOR
UnityEditor.EditorApplication.isPlaying = false;
#else
Application.Quit();
#endif
}
}
+6
View File
@@ -16,6 +16,12 @@ public class PlayerController : MonoBehaviour
void Update()
{
if (PauseMenu.GameIsPaused)
{
position = Vector3.zero;
return;
}
position = Vector3.zero;
if (Input.GetKey(KeyCode.W))
{
+18
View File
@@ -6,19 +6,35 @@ public class Shoot : MonoBehaviour
[SerializeField] GameObject bulletPrefab;
[SerializeField] Transform spawnPointAR;
[SerializeField] Transform spawnPointPistol;
[SerializeField] WeaponReload weapon;
[SerializeField] float fireRate = 0.15f;
[SerializeField] bool AR = true;
[SerializeField] bool Pistole = true;
private float nextShotTime;
void Start()
{
<<<<<<< HEAD
=======
if (weapon == null)
weapon = FindFirstObjectByType<WeaponReload>();
>>>>>>> 85ece045864c59c50ed55097c35e2c15b9051a0f
}
void Update()
{
<<<<<<< HEAD
if (AR == true && Input.GetKey(KeyCode.Mouse0))
=======
if (PauseMenu.GameIsPaused) return;
if (AR == true && Input.GetKey(KeyCode.Mouse0) && Time.time >= nextShotTime)
>>>>>>> 85ece045864c59c50ed55097c35e2c15b9051a0f
{
Shot(spawnPointAR);
nextShotTime = Time.time + fireRate;
}
else if (Pistole == true && Input.GetKeyDown(KeyCode.Mouse0))
{
@@ -27,6 +43,8 @@ public class Shoot : MonoBehaviour
}
public void Shot(Transform spawnPoint)
{
if (spawnPoint == null || weapon == null || !weapon.UseAmmo()) return;
GameObject bullet = Instantiate(bulletPrefab, spawnPoint.position, spawnPoint.rotation);
bullet.transform.Rotate(90, 0, 0);
}
+11 -18
View File
@@ -17,6 +17,8 @@ public class WeaponReload : MonoBehaviour
void Update()
{
if (PauseMenu.GameIsPaused) return;
// Während nachgeladen wird, keine Aktionen zulassen
if (isReloading)
return;
@@ -29,30 +31,21 @@ public class WeaponReload : MonoBehaviour
return;
}
// 2. Automatisches Nachladen beim Schießen, wenn das Magazin leer (<= 0) ist
if (Input.GetButtonDown("Fire1"))
{
if (currentAmmo > 0)
{
Shoot();
}
else
{
// Magazin ist leer -> automatisch nachladen!
StartCoroutine(Reload());
}
}
}
void Shoot()
public bool UseAmmo()
{
// Nur schießen, wenn das Pausemenü NICHT offen ist
if (PausenManager.GameIsPaused) return;
if (PauseMenu.GameIsPaused || isReloading) return false;
if (currentAmmo <= 0)
{
StartCoroutine(Reload());
return false;
}
currentAmmo--;
Debug.Log("Schuss gefeuert! Verbleibende Munition: " + currentAmmo);
// Hier deinen normalen Schuss-Code einfügen (Raycast, Bullet-Prefab, Ton etc.)
return true;
}
// Coroutine für die Nachlade-Verzögerung