Small fixes
This commit is contained in:
@@ -165,6 +165,7 @@ MonoBehaviour:
|
|||||||
m_ScoreText: {fileID: 1501855168}
|
m_ScoreText: {fileID: 1501855168}
|
||||||
m_DefaultMaterial: {fileID: 2100000, guid: 2b4111cfdf7255c48b4c3dbcf9e202a6, type: 2}
|
m_DefaultMaterial: {fileID: 2100000, guid: 2b4111cfdf7255c48b4c3dbcf9e202a6, type: 2}
|
||||||
m_FreeHitMaterial: {fileID: 2100000, guid: 22eb1f2017d2a15459d4c10b27104270, type: 2}
|
m_FreeHitMaterial: {fileID: 2100000, guid: 22eb1f2017d2a15459d4c10b27104270, type: 2}
|
||||||
|
m_PostProcessVolume: {fileID: 519420033}
|
||||||
--- !u!4 &104400498
|
--- !u!4 &104400498
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
@@ -32,16 +32,16 @@ MonoBehaviour:
|
|||||||
value: 1
|
value: 1
|
||||||
intensity:
|
intensity:
|
||||||
overrideState: 1
|
overrideState: 1
|
||||||
value: 15
|
value: 10
|
||||||
threshold:
|
threshold:
|
||||||
overrideState: 1
|
overrideState: 1
|
||||||
value: 0.4
|
value: 0
|
||||||
softKnee:
|
softKnee:
|
||||||
overrideState: 1
|
overrideState: 1
|
||||||
value: 0.5
|
value: 0.5
|
||||||
clamp:
|
clamp:
|
||||||
overrideState: 1
|
overrideState: 1
|
||||||
value: 1
|
value: 35
|
||||||
diffusion:
|
diffusion:
|
||||||
overrideState: 1
|
overrideState: 1
|
||||||
value: 3
|
value: 3
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ using System;
|
|||||||
using System.Collections;
|
using System.Collections;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
using UnityEngine.Rendering.PostProcessing;
|
||||||
|
|
||||||
public class PlayerController : OrbitalPositionBehaviour
|
public class PlayerController : OrbitalPositionBehaviour
|
||||||
{
|
{
|
||||||
@@ -18,15 +19,20 @@ public class PlayerController : OrbitalPositionBehaviour
|
|||||||
|
|
||||||
private bool m_HasFreeHitActive;
|
private bool m_HasFreeHitActive;
|
||||||
private bool m_HasInvicibility;
|
private bool m_HasInvicibility;
|
||||||
|
|
||||||
|
private Bloom m_BloomController;
|
||||||
|
|
||||||
[Header("References")]
|
[Header("References")]
|
||||||
[SerializeField] private MeshRenderer m_Renderer;
|
[SerializeField] private MeshRenderer m_Renderer;
|
||||||
[SerializeField] private Text m_ScoreText;
|
[SerializeField] private Text m_ScoreText;
|
||||||
[SerializeField] private Material m_DefaultMaterial;
|
[SerializeField] private Material m_DefaultMaterial;
|
||||||
[SerializeField] private Material m_FreeHitMaterial;
|
[SerializeField] private Material m_FreeHitMaterial;
|
||||||
|
[SerializeField] private PostProcessVolume m_PostProcessVolume;
|
||||||
|
|
||||||
protected override void OnStart()
|
protected override void OnStart()
|
||||||
{
|
{
|
||||||
|
m_BloomController = m_PostProcessVolume.profile.GetSetting<Bloom>();
|
||||||
|
|
||||||
s_Instance = this;
|
s_Instance = this;
|
||||||
s_HighScore = Mathf.Max(s_HighScore, PlayerPrefs.GetInt("HighScore", 0));
|
s_HighScore = Mathf.Max(s_HighScore, PlayerPrefs.GetInt("HighScore", 0));
|
||||||
Debug.Log($"Loaded high score of [{s_HighScore}]");
|
Debug.Log($"Loaded high score of [{s_HighScore}]");
|
||||||
@@ -39,6 +45,11 @@ public class PlayerController : OrbitalPositionBehaviour
|
|||||||
|
|
||||||
public void Update()
|
public void Update()
|
||||||
{
|
{
|
||||||
|
if (!m_KillingItself)
|
||||||
|
{
|
||||||
|
m_BloomController.diffusion.value = 3f;
|
||||||
|
}
|
||||||
|
|
||||||
m_ScoreText.text = s_PlayerScore.ToString();
|
m_ScoreText.text = s_PlayerScore.ToString();
|
||||||
if (s_PlayerScore > s_HighScore)
|
if (s_PlayerScore > s_HighScore)
|
||||||
m_ScoreText.color = Color.yellow;
|
m_ScoreText.color = Color.yellow;
|
||||||
@@ -84,11 +95,6 @@ public class PlayerController : OrbitalPositionBehaviour
|
|||||||
m_OrbitalPosition.m_ObjectRadius /= 0.6f;
|
m_OrbitalPosition.m_ObjectRadius /= 0.6f;
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerator OnSpeedUpModifier()
|
|
||||||
{
|
|
||||||
yield return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IEnumerator TriggerInvicibility()
|
private IEnumerator TriggerInvicibility()
|
||||||
{
|
{
|
||||||
m_HasFreeHitActive = false;
|
m_HasFreeHitActive = false;
|
||||||
@@ -121,11 +127,12 @@ public class PlayerController : OrbitalPositionBehaviour
|
|||||||
m_SuicidePoint = transform.position;
|
m_SuicidePoint = transform.position;
|
||||||
m_KillingItself = true;
|
m_KillingItself = true;
|
||||||
m_DeathLerp = 0f;
|
m_DeathLerp = 0f;
|
||||||
|
|
||||||
|
//m_BloomController.diffusion.value = 10f;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (other.CompareTag("PlayerMod"))
|
else if (other.CompareTag("PlayerMod"))
|
||||||
{
|
{
|
||||||
Debug.Log($"Collision with player mod [{((PlayerModifier)other).HeldModifier}]");
|
|
||||||
switch (((PlayerModifier)other).HeldModifier)
|
switch (((PlayerModifier)other).HeldModifier)
|
||||||
{
|
{
|
||||||
case PlayerModifier.Modifier.GainPoints:
|
case PlayerModifier.Modifier.GainPoints:
|
||||||
@@ -156,8 +163,6 @@ public class PlayerController : OrbitalPositionBehaviour
|
|||||||
Debug.Log($"Collision with unknown modifier occured [{((PlayerModifier)other).HeldModifier}]");
|
Debug.Log($"Collision with unknown modifier occured [{((PlayerModifier)other).HeldModifier}]");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug.Log("Collided with player mod");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -18,8 +18,6 @@ public class PlayerModifier : OrbitalPositionBehaviour
|
|||||||
|
|
||||||
private static Modifier GetRandomModifier()
|
private static Modifier GetRandomModifier()
|
||||||
{
|
{
|
||||||
return Modifier.SpeedUp;
|
|
||||||
|
|
||||||
Array possibilities = Enum.GetValues(typeof(Modifier));
|
Array possibilities = Enum.GetValues(typeof(Modifier));
|
||||||
return (Modifier)possibilities.GetValue(s_RandomGenerator.Next(possibilities.Length));
|
return (Modifier)possibilities.GetValue(s_RandomGenerator.Next(possibilities.Length));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user