From 37c0ad09910044e3ebb79558831aef557a143b9f Mon Sep 17 00:00:00 2001 From: Pasha Bibko <156938226+PashaBibko@users.noreply.github.com> Date: Thu, 27 Nov 2025 13:50:47 +0000 Subject: [PATCH] Small fixes --- Assets/Scenes/SampleScene.unity | 1 + .../Main Camera Profile.asset | 6 +++--- Assets/Scripts/PlayerController.cs | 21 ++++++++++++------- Assets/Scripts/PlayerModifier.cs | 2 -- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index 3b28eee..e5983f0 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -165,6 +165,7 @@ MonoBehaviour: m_ScoreText: {fileID: 1501855168} m_DefaultMaterial: {fileID: 2100000, guid: 2b4111cfdf7255c48b4c3dbcf9e202a6, type: 2} m_FreeHitMaterial: {fileID: 2100000, guid: 22eb1f2017d2a15459d4c10b27104270, type: 2} + m_PostProcessVolume: {fileID: 519420033} --- !u!4 &104400498 Transform: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/SampleScene_Profiles/Main Camera Profile.asset b/Assets/Scenes/SampleScene_Profiles/Main Camera Profile.asset index 5fb9118..68de1bb 100644 --- a/Assets/Scenes/SampleScene_Profiles/Main Camera Profile.asset +++ b/Assets/Scenes/SampleScene_Profiles/Main Camera Profile.asset @@ -32,16 +32,16 @@ MonoBehaviour: value: 1 intensity: overrideState: 1 - value: 15 + value: 10 threshold: overrideState: 1 - value: 0.4 + value: 0 softKnee: overrideState: 1 value: 0.5 clamp: overrideState: 1 - value: 1 + value: 35 diffusion: overrideState: 1 value: 3 diff --git a/Assets/Scripts/PlayerController.cs b/Assets/Scripts/PlayerController.cs index a7cf4fc..0a08275 100644 --- a/Assets/Scripts/PlayerController.cs +++ b/Assets/Scripts/PlayerController.cs @@ -2,6 +2,7 @@ using System; using System.Collections; using UnityEngine; using UnityEngine.UI; +using UnityEngine.Rendering.PostProcessing; public class PlayerController : OrbitalPositionBehaviour { @@ -18,15 +19,20 @@ public class PlayerController : OrbitalPositionBehaviour private bool m_HasFreeHitActive; private bool m_HasInvicibility; + + private Bloom m_BloomController; [Header("References")] [SerializeField] private MeshRenderer m_Renderer; [SerializeField] private Text m_ScoreText; [SerializeField] private Material m_DefaultMaterial; [SerializeField] private Material m_FreeHitMaterial; + [SerializeField] private PostProcessVolume m_PostProcessVolume; protected override void OnStart() { + m_BloomController = m_PostProcessVolume.profile.GetSetting(); + s_Instance = this; s_HighScore = Mathf.Max(s_HighScore, PlayerPrefs.GetInt("HighScore", 0)); Debug.Log($"Loaded high score of [{s_HighScore}]"); @@ -39,6 +45,11 @@ public class PlayerController : OrbitalPositionBehaviour public void Update() { + if (!m_KillingItself) + { + m_BloomController.diffusion.value = 3f; + } + m_ScoreText.text = s_PlayerScore.ToString(); if (s_PlayerScore > s_HighScore) m_ScoreText.color = Color.yellow; @@ -84,11 +95,6 @@ public class PlayerController : OrbitalPositionBehaviour m_OrbitalPosition.m_ObjectRadius /= 0.6f; } - private IEnumerator OnSpeedUpModifier() - { - yield return null; - } - private IEnumerator TriggerInvicibility() { m_HasFreeHitActive = false; @@ -121,11 +127,12 @@ public class PlayerController : OrbitalPositionBehaviour m_SuicidePoint = transform.position; m_KillingItself = true; m_DeathLerp = 0f; + + //m_BloomController.diffusion.value = 10f; } else if (other.CompareTag("PlayerMod")) { - Debug.Log($"Collision with player mod [{((PlayerModifier)other).HeldModifier}]"); switch (((PlayerModifier)other).HeldModifier) { case PlayerModifier.Modifier.GainPoints: @@ -156,8 +163,6 @@ public class PlayerController : OrbitalPositionBehaviour Debug.Log($"Collision with unknown modifier occured [{((PlayerModifier)other).HeldModifier}]"); break; } - - Debug.Log("Collided with player mod"); } else diff --git a/Assets/Scripts/PlayerModifier.cs b/Assets/Scripts/PlayerModifier.cs index d02f58d..2bf7af0 100644 --- a/Assets/Scripts/PlayerModifier.cs +++ b/Assets/Scripts/PlayerModifier.cs @@ -18,8 +18,6 @@ public class PlayerModifier : OrbitalPositionBehaviour private static Modifier GetRandomModifier() { - return Modifier.SpeedUp; - Array possibilities = Enum.GetValues(typeof(Modifier)); return (Modifier)possibilities.GetValue(s_RandomGenerator.Next(possibilities.Length)); }