Small fixes
This commit is contained in:
@@ -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<Bloom>();
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user