Games that override ondestroy now destroy their inputs when they are destroyed (#449)

This commit is contained in:
Rapandrasmus 2023-06-04 01:30:17 +02:00 committed by GitHub
parent 761ae362e1
commit bb6559fe58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 111 additions and 1 deletions

View file

@ -110,6 +110,10 @@ namespace HeavenStudio.Games
void OnDestroy()
{
if (queuedVoiceLines.Count > 0) queuedVoiceLines.Clear();
foreach (var evt in scheduledInputs)
{
evt.Disable();
}
}
void Start()

View file

@ -116,6 +116,10 @@ namespace HeavenStudio.Games
rightCrumbAppearThreshold = 15;
leftCrumbAppearThreshold = 30;
eatenTreats = 0;
foreach (var evt in scheduledInputs)
{
evt.Disable();
}
}
private void Awake()

View file

@ -181,6 +181,10 @@ namespace HeavenStudio.Games
currentShooterColor = Color.white;
currentEnvironmentColor = new Color(0, 1, 0, 1);
UpdateColors();
foreach (var evt in scheduledInputs)
{
evt.Disable();
}
}
private void Start()

View file

@ -178,6 +178,10 @@ namespace HeavenStudio.Games
void OnDestroy()
{
Jukebox.KillLoop(SpinningLoop, 0.5f);
foreach (var evt in scheduledInputs)
{
evt.Disable();
}
}
public override void OnTimeChange()

View file

@ -185,6 +185,10 @@ namespace HeavenStudio.Games
if (!Conductor.instance.isPlaying || Conductor.instance.isPaused) {
if (queuedThrows.Count > 0) queuedThrows.Clear();
}
foreach (var evt in scheduledInputs)
{
evt.Disable();
}
}
private void Update()

View file

@ -116,6 +116,10 @@ namespace HeavenStudio.Games
private void OnDestroy() {
queuedBalls.Clear();
foreach (var evt in scheduledInputs)
{
evt.Disable();
}
}
private void Awake()

View file

@ -132,6 +132,10 @@ namespace HeavenStudio.Games
void OnDestroy()
{
if (queuedFireworks.Count > 0) queuedFireworks.Clear();
foreach (var evt in scheduledInputs)
{
evt.Disable();
}
}
void Awake()

View file

@ -166,6 +166,10 @@ namespace HeavenStudio.Games
{
if (queuedInputs.Count > 0) queuedInputs.Clear();
}
foreach (var evt in scheduledInputs)
{
evt.Disable();
}
}
private void Awake()

View file

@ -188,6 +188,10 @@ namespace HeavenStudio.Games
if (queuedInputs.Count > 0) queuedInputs.Clear();
if (queuedAttentions.Count > 0) queuedAttentions.Clear();
if (queuedFlipperRollVoiceLines.Count > 0) queuedFlipperRollVoiceLines.Clear();
foreach (var evt in scheduledInputs)
{
evt.Disable();
}
}
private void Update()

View file

@ -178,6 +178,10 @@ namespace HeavenStudio.Games
if (queuedSingings.Count > 0) queuedSingings.Clear();
if (queuedBatons.Count > 0) queuedBatons.Clear();
}
foreach (var evt in scheduledInputs)
{
evt.Disable();
}
}
void Update()

View file

@ -205,6 +205,10 @@ namespace HeavenStudio.Games
void OnDestroy()
{
if (queuedRockets.Count > 0) queuedRockets.Clear();
foreach (var evt in scheduledInputs)
{
evt.Disable();
}
}
void Awake()

View file

@ -194,6 +194,10 @@ namespace HeavenStudio.Games
void OnDestroy()
{
if (queuedInputs.Count > 0) queuedInputs.Clear();
foreach (var evt in scheduledInputs)
{
evt.Disable();
}
}
void UpdateAndRenderSlaves()

View file

@ -119,6 +119,10 @@ namespace HeavenStudio.Games
if (queuedIntervals.Count > 0) queuedIntervals.Clear();
intervalStarted = false;
}
foreach (var evt in scheduledInputs)
{
evt.Disable();
}
}
private void Update()

View file

@ -134,6 +134,10 @@ namespace HeavenStudio.Games
// these variables wouldn't get reset, even when you go in and out of unity play mode???
shouldBlip = false;
stepIterate = 0;
foreach (var evt in scheduledInputs)
{
evt.Disable();
}
}
public void Update()

View file

@ -244,6 +244,11 @@ namespace HeavenStudio.Games
inputsTilGrow = 10;
noBlush = false;
disableBaby = false;
foreach (var evt in scheduledInputs)
{
evt.Disable();
}
}
private void Update()

View file

@ -229,6 +229,11 @@ namespace HeavenStudio.Games
if (queuedPops.Count > 0) queuedPops.Clear();
mat.SetColor("_ColorAlpha", new Color(0.97f, 0.235f, 0.54f));
foreach (var evt in scheduledInputs)
{
evt.Disable();
}
}
private void Update()

View file

@ -195,6 +195,10 @@ namespace HeavenStudio.Games
{
if (queuedInputs.Count > 0) queuedInputs.Clear();
}
foreach (var evt in scheduledInputs)
{
evt.Disable();
}
}
void Awake()

View file

@ -269,6 +269,10 @@ namespace HeavenStudio.Games
{
crHandlerInstance = null;
}
foreach (var evt in scheduledInputs)
{
evt.Disable();
}
}
public static void SpawnHairInactive(float beat)

View file

@ -164,6 +164,10 @@ namespace HeavenStudio.Games
{
if (queuedPoses.Count > 0) queuedPoses.Clear();
Jukebox.KillLoop(kidsLaugh, 2f);
foreach (var evt in scheduledInputs)
{
evt.Disable();
}
}
public override void OnTimeChange()

View file

@ -545,6 +545,10 @@ namespace HeavenStudio.Games
}
if (queuedCameraEvents.Count > 0) queuedCameraEvents.Clear();
if (queuedPreInterval.Count > 0) queuedPreInterval.Clear();
foreach (var evt in scheduledInputs)
{
evt.Disable();
}
}
private void Update()

View file

@ -94,6 +94,10 @@ namespace HeavenStudio.Games
{
if (queuedGhosts.Count > 0) queuedGhosts.Clear();
Conductor.instance.SetMinigamePitch(1f);
foreach (var evt in scheduledInputs)
{
evt.Disable();
}
}
void Awake()

View file

@ -156,6 +156,10 @@ namespace HeavenStudio.Games
{
if (queuedInputs.Count > 0) queuedInputs.Clear();
}
foreach (var evt in scheduledInputs)
{
evt.Disable();
}
}
void Update()

View file

@ -165,6 +165,10 @@ namespace HeavenStudio.Games
if (queuedSteps.Count > 0) queuedSteps.Clear();
if (queuedTaps.Count > 0) queuedTaps.Clear();
prepareTap = false;
foreach (var evt in scheduledInputs)
{
evt.Disable();
}
}
public override void OnTimeChange()

View file

@ -209,6 +209,10 @@ namespace HeavenStudio.Games
{
if (queuedPoses.Count > 0) queuedPoses.Clear();
if (queuedCrouches.Count > 0) queuedCrouches.Clear();
foreach (var evt in scheduledInputs)
{
evt.Disable();
}
}
void Awake()

View file

@ -101,6 +101,10 @@ namespace HeavenStudio.Games
void OnDestroy()
{
if (queuedInputs.Count > 0) queuedInputs.Clear();
foreach (var evt in scheduledInputs)
{
evt.Disable();
}
}
private void Awake()

View file

@ -85,6 +85,10 @@ namespace HeavenStudio.Games
void OnDestroy()
{
if (queuedInputs.Count > 0) queuedInputs.Clear();
foreach (var evt in scheduledInputs)
{
evt.Disable();
}
}
private void Start()

View file

@ -477,6 +477,10 @@ namespace HeavenStudio.Games
{
if (queuedIntervals.Count > 0) queuedIntervals.Clear();
if (queuedBalls.Count > 0) queuedBalls.Clear();
foreach (var evt in scheduledInputs)
{
evt.Disable();
}
}
void Update()