Made player mods affect the player
This commit is contained in:
@@ -35,12 +35,14 @@ public class Ring : MonoBehaviour
|
||||
|
||||
public class GlobalOrbitalPositionManager : MonoBehaviour
|
||||
{
|
||||
private static GlobalOrbitalPositionManager s_Instance = null;
|
||||
private static GlobalOrbitalPositionManager s_Instance;
|
||||
public static GlobalOrbitalPositionManager Instance => s_Instance;
|
||||
|
||||
private readonly List<OrbitalPosition> m_ObjectInstances = new();
|
||||
private readonly List<Ring> m_Rings = new();
|
||||
private readonly Dictionary<int, float> m_Distances = new();
|
||||
|
||||
public static bool IsSimulationRunning = true;
|
||||
public static bool s_IsSimulationRunning = true;
|
||||
|
||||
private OrbitalPosition m_PlayerOrbitalPosition;
|
||||
public static void SetPlayer(OrbitalPosition player) => s_Instance.m_PlayerOrbitalPosition = player;
|
||||
@@ -60,6 +62,15 @@ public class GlobalOrbitalPositionManager : MonoBehaviour
|
||||
private bool m_CurrentRingAllowsSpawning;
|
||||
|
||||
private Vector3[] m_PrecalculatedPositions;
|
||||
|
||||
public IEnumerator StartPlayerSpeedupModifier()
|
||||
{
|
||||
m_LocalDeltaTimeScale *= 2f;
|
||||
|
||||
yield return new WaitForSeconds(10f);
|
||||
|
||||
m_LocalDeltaTimeScale /= 2f;
|
||||
}
|
||||
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] private static void OnApplicationStart()
|
||||
{
|
||||
@@ -84,7 +95,7 @@ public class GlobalOrbitalPositionManager : MonoBehaviour
|
||||
|
||||
private static IEnumerator RestartSimulationInternal()
|
||||
{
|
||||
IsSimulationRunning = false;
|
||||
s_IsSimulationRunning = false;
|
||||
|
||||
s_Instance.m_LocalDeltaTimeScale = 7f;
|
||||
AllowPlayerInput = false;
|
||||
@@ -106,7 +117,7 @@ public class GlobalOrbitalPositionManager : MonoBehaviour
|
||||
AllowPlayerInput = true;
|
||||
s_Instance.m_LocalDeltaTimeScale = 1f;
|
||||
|
||||
IsSimulationRunning = true;
|
||||
s_IsSimulationRunning = true;
|
||||
}
|
||||
|
||||
public static void RestartSimulation() => s_Instance.StartCoroutine(RestartSimulationInternal());
|
||||
@@ -160,7 +171,7 @@ public class GlobalOrbitalPositionManager : MonoBehaviour
|
||||
Color c = Color.Lerp(Color.black, Color.white, Mathf.Clamp01(lerp));
|
||||
if (ring.transform.localScale.x < 0.5f)
|
||||
{
|
||||
if (IsSimulationRunning)
|
||||
if (s_IsSimulationRunning)
|
||||
PlayerController.s_PlayerScore++;
|
||||
|
||||
toRemove.Add(ring);
|
||||
|
||||
Reference in New Issue
Block a user