Merge branch 'main' of https://git.bib.de/PBA3H25ABU/ClearTheZone
This commit is contained in:
+10
-10
@@ -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
|
||||
|
||||
+21
-33
@@ -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:
|
||||
@@ -214,6 +214,8 @@ MonoBehaviour:
|
||||
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
|
||||
@@ -486,10 +488,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
|
||||
@@ -851,16 +853,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
|
||||
@@ -978,9 +980,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}
|
||||
@@ -1577,7 +1579,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}
|
||||
@@ -1854,7 +1856,6 @@ GameObject:
|
||||
- component: {fileID: 1985753435}
|
||||
- component: {fileID: 1985753434}
|
||||
- component: {fileID: 1985753433}
|
||||
- component: {fileID: 1985753437}
|
||||
m_Layer: 5
|
||||
m_Name: "pausenmen\xFC"
|
||||
m_TagString: Untagged
|
||||
@@ -1948,19 +1949,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
|
||||
|
||||
@@ -26,6 +26,8 @@ public class Door_Rotate : MonoBehaviour
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (PauseMenu.GameIsPaused) return;
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.E) && IsPlayerLooking())
|
||||
{
|
||||
ToggleDoor();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
+11
-2
@@ -6,19 +6,26 @@ 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()
|
||||
{
|
||||
|
||||
if (weapon == null)
|
||||
weapon = FindFirstObjectByType<WeaponReload>();
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (PauseMenu.GameIsPaused) return;
|
||||
|
||||
if ( AR == true && Input.GetKey(KeyCode.Mouse0))
|
||||
if (AR == true && Input.GetKey(KeyCode.Mouse0) && Time.time >= nextShotTime)
|
||||
{
|
||||
Shot(spawnPointAR);
|
||||
nextShotTime = Time.time + fireRate;
|
||||
}
|
||||
else if (Pistole == true && Input.GetKeyDown(KeyCode.Mouse0))
|
||||
{
|
||||
@@ -27,6 +34,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);
|
||||
Destroy(bullet, 2);
|
||||
|
||||
@@ -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
|
||||
@@ -73,4 +66,4 @@ public class WeaponReload : MonoBehaviour
|
||||
isReloading = false;
|
||||
Debug.Log("Nachladen abgeschlossen! Munition wieder voll: " + currentAmmo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user