Added player mod (powerups)
This commit is contained in:
@@ -57,6 +57,8 @@ public class GlobalOrbitalPositionManager : MonoBehaviour
|
||||
private float m_LocalDeltaTimeScale = 1f;
|
||||
private float LocalDeltaTime => Time.deltaTime * m_LocalDeltaTimeScale;
|
||||
|
||||
private bool m_CurrentRingAllowsSpawning;
|
||||
|
||||
private Vector3[] m_PrecalculatedPositions;
|
||||
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] private static void OnApplicationStart()
|
||||
@@ -129,6 +131,10 @@ public class GlobalOrbitalPositionManager : MonoBehaviour
|
||||
|
||||
m_LastGeneratedRing = ring.m_ID;
|
||||
m_TimeOfLastRingSpawn = Time.time;
|
||||
|
||||
m_CurrentRingAllowsSpawning = Random.Range(0, 25) != 0;
|
||||
if (!m_CurrentRingAllowsSpawning && AllowPlayerInput)
|
||||
Instantiate(GlobalOrbitalSettings.ModifierPrefab);
|
||||
}
|
||||
|
||||
List<Ring> toRemove = new();
|
||||
@@ -209,7 +215,7 @@ public class GlobalOrbitalPositionManager : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
if (Random.Range(0, 20) == 0 && AllowPlayerInput)
|
||||
if (Random.Range(0, 20) == 0 && AllowPlayerInput && m_CurrentRingAllowsSpawning)
|
||||
Instantiate(GlobalOrbitalSettings.EnemyPrefab);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user