From 69fd62b3ac03cbc9d436d775db44b67363f95a29 Mon Sep 17 00:00:00 2001 From: Pasha Bibko <156938226+PashaBibko@users.noreply.github.com> Date: Thu, 29 Jan 2026 13:54:10 +0000 Subject: [PATCH] Fixed small issues found in playtesting --- Assets/Prefabs/PlayerReplayer.prefab | 7 +++--- Assets/Scenes/WorldScene.unity | 22 +++++++++++++++++++ Assets/{tmp.cs => Scripts/CamRatioFixer.cs} | 4 +--- .../CamRatioFixer.cs.meta} | 2 +- Assets/Scripts/HealthBar.cs | 8 ++++--- Assets/Scripts/PlayerController.cs | 3 ++- Assets/Scripts/WindowBase.cs | 2 +- Assets/Scripts/WindowSpawner.cs | 5 +++-- 8 files changed, 39 insertions(+), 14 deletions(-) rename Assets/{tmp.cs => Scripts/CamRatioFixer.cs} (87%) rename Assets/{tmp.cs.meta => Scripts/CamRatioFixer.cs.meta} (83%) diff --git a/Assets/Prefabs/PlayerReplayer.prefab b/Assets/Prefabs/PlayerReplayer.prefab index b8c6a9d..b48f1e1 100644 --- a/Assets/Prefabs/PlayerReplayer.prefab +++ b/Assets/Prefabs/PlayerReplayer.prefab @@ -72,7 +72,7 @@ GameObject: m_Component: - component: {fileID: 1807660236798938897} - component: {fileID: 1013965729963872153} - - component: {fileID: 1783748808844086845} + - component: {fileID: 4207089029311380441} - component: {fileID: 7220179918976106526} - component: {fileID: 7410036744236083586} - component: {fileID: 9011244016352067911} @@ -134,7 +134,8 @@ MonoBehaviour: - {fileID: 8300000, guid: 413764415f5bf42429d26861fc5e82cf, type: 3} - {fileID: 8300000, guid: 21713b7ac8710bf4fb3b949bbbebb67a, type: 3} PlayerAudioSource: {fileID: 3380663186425371797} ---- !u!114 &1783748808844086845 + HealthTracker: {fileID: 0} +--- !u!114 &4207089029311380441 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -143,7 +144,7 @@ MonoBehaviour: m_GameObject: {fileID: 5082956827802089079} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: ab982c94ab064b944947c4792e623299, type: 3} + m_Script: {fileID: 11500000, guid: 3d33e1862ff5809499d3187e38cf80a7, type: 3} m_Name: m_EditorClassIdentifier: cam: {fileID: 7220179918976106526} diff --git a/Assets/Scenes/WorldScene.unity b/Assets/Scenes/WorldScene.unity index 6d99f4b..d13c871 100644 --- a/Assets/Scenes/WorldScene.unity +++ b/Assets/Scenes/WorldScene.unity @@ -340,6 +340,11 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 0} m_Modifications: + - target: {fileID: 1013965729963872153, guid: 2b0bfd2786fee6740a799a99023f5000, + type: 3} + propertyPath: HealthTracker + value: + objectReference: {fileID: 1003288351} - target: {fileID: 1013965729963872153, guid: 2b0bfd2786fee6740a799a99023f5000, type: 3} propertyPath: ExternalCamera @@ -991,6 +996,18 @@ Transform: type: 3} m_PrefabInstance: {fileID: 739366992} m_PrefabAsset: {fileID: 0} +--- !u!114 &1003288351 stripped +MonoBehaviour: + m_CorrespondingSourceObject: {fileID: 582498797338587669, guid: c0a03ce6c4f39224299267b83719ceb7, + type: 3} + m_PrefabInstance: {fileID: 739366992} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 260819a4950a1f54d921ee3d6b3da010, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!4 &1004516925 stripped Transform: m_CorrespondingSourceObject: {fileID: 4872202698225962268, guid: ffc439d5d7c92f14aa90c763e1cde8d2, @@ -1265,6 +1282,11 @@ PrefabInstance: propertyPath: HittyThingThatSkyDidntWantMeToNameItLikeThisAndInsteadNameItPropely value: objectReference: {fileID: 112955761} + - target: {fileID: 6630605910866455705, guid: e29ce1fe47a855c4e907d4312c9e9d6e, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] diff --git a/Assets/tmp.cs b/Assets/Scripts/CamRatioFixer.cs similarity index 87% rename from Assets/tmp.cs rename to Assets/Scripts/CamRatioFixer.cs index 575abda..8ede2ea 100644 --- a/Assets/tmp.cs +++ b/Assets/Scripts/CamRatioFixer.cs @@ -1,8 +1,6 @@ -using System.Collections; -using System.Collections.Generic; using UnityEngine; -public class tmp : MonoBehaviour +public class CamRatioFixer : MonoBehaviour { public Camera cam; diff --git a/Assets/tmp.cs.meta b/Assets/Scripts/CamRatioFixer.cs.meta similarity index 83% rename from Assets/tmp.cs.meta rename to Assets/Scripts/CamRatioFixer.cs.meta index 8190d46..ec68b8e 100644 --- a/Assets/tmp.cs.meta +++ b/Assets/Scripts/CamRatioFixer.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ab982c94ab064b944947c4792e623299 +guid: 3d33e1862ff5809499d3187e38cf80a7 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Scripts/HealthBar.cs b/Assets/Scripts/HealthBar.cs index eaaec67..f89706a 100644 --- a/Assets/Scripts/HealthBar.cs +++ b/Assets/Scripts/HealthBar.cs @@ -7,11 +7,13 @@ namespace InterfaceOff.WorldScene public Transform HealthBarObject; public WindowSpawner Spawner; public LifeThingTrackerThing Thing; - + + public int Health { get; private set; } + private void Update() { - float scale = ((20 - Thing.HitsTaken) - Spawner.SpawnedWindowCount) * 5f; - scale = Mathf.Clamp(scale, 0f, Mathf.Infinity); + Health = ((20 - Thing.HitsTaken) - Spawner.SpawnedWindowCount); + float scale = Mathf.Clamp(Health * 5f, 0f, Mathf.Infinity); if (!Spawner.AutoSpawn) { diff --git a/Assets/Scripts/PlayerController.cs b/Assets/Scripts/PlayerController.cs index af6e0e7..20c0124 100644 --- a/Assets/Scripts/PlayerController.cs +++ b/Assets/Scripts/PlayerController.cs @@ -22,6 +22,7 @@ namespace InterfaceOff.WorldScene [SerializeField] private GameObject MovingObject; [SerializeField] private AudioClip[] AudioClips; [SerializeField] private AudioSource PlayerAudioSource; + [SerializeField] private HealthBar HealthTracker; public static void PlayRandomErrorSound() { @@ -61,7 +62,7 @@ namespace InterfaceOff.WorldScene /* Iterates the frame index */ FrameIndex = (FrameIndex + 1) % (Frames.Length - 2); - if (DeathIndices.Contains(FrameIndex) && ActiveWindowSpawner.SpawnedWindowCount > MAX_WINDOWS) + if (DeathIndices.Contains(FrameIndex) && HealthTracker.Health <= 0) { ActiveWindowSpawner.StartEndSequence(); PlayerAlive = false; diff --git a/Assets/Scripts/WindowBase.cs b/Assets/Scripts/WindowBase.cs index 3b0b23a..66042d9 100644 --- a/Assets/Scripts/WindowBase.cs +++ b/Assets/Scripts/WindowBase.cs @@ -66,8 +66,8 @@ namespace InterfaceOff public void DestroyWindow() { - StartCoroutine(routine: DeathSequence()); Creator.AlertOfDespawnedWindow(); + StartCoroutine(routine: DeathSequence()); } private IEnumerator DeathSequence() diff --git a/Assets/Scripts/WindowSpawner.cs b/Assets/Scripts/WindowSpawner.cs index 903a0c6..4193358 100644 --- a/Assets/Scripts/WindowSpawner.cs +++ b/Assets/Scripts/WindowSpawner.cs @@ -95,7 +95,7 @@ namespace InterfaceOff public void AlertOfDespawnedWindow() => SpawnedWindowCount--; - private int SpawnyThingyMajig = 9000; // Sky chose dis + private int SpawnyThingyMajig = 40 * 25; // Sky chose dis private void FixedUpdate() { @@ -106,7 +106,8 @@ namespace InterfaceOff if (SpawnyThingyMajig == 0) { PasswordField.SetActive(true); - SpawnyThingyMajig = Random.Range(2000, 10000); + SpawnyThingyMajig = Random.Range(40 * 15, 40 * 20); + Debug.Log($"[{Time.timeSinceLevelLoad}]"); } else {