TO SQUASH: Added spark effect to game over screen.

This commit is contained in:
2026-08-04 21:53:25 -04:00
parent 7fcbd5a38a
commit f1a2229774
12 changed files with 455 additions and 123 deletions
+9
View File
@@ -0,0 +1,9 @@
using UnityEngine;
public class Spark : MonoBehaviour
{
public void AnimationFinished()
{
Destroy(gameObject);
}
}
+2
View File
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 52855152b4d292bf982eb8fb625516a6
+46
View File
@@ -0,0 +1,46 @@
using UnityEngine;
public class Smoke : MonoBehaviour
{
public float smokeDuration = 1.5f; // Duration in seconds for the smoke effect
public float sparkTimer = 0.1f; // Timer for spark effect
public GameObject sparkEffectPrefab; // Prefab for the spark effect
private float smokeTimer = 0.0f;
private float sparkEffectTimer = 0.0f;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
}
// Update is called once per frame
void Update()
{
smokeTimer += Time.deltaTime;
if (smokeTimer >= smokeDuration)
{
Destroy(gameObject);
}
else
{
sparkEffectTimer += Time.deltaTime;
if (sparkEffectTimer >= sparkTimer)
{
sparkEffectTimer = 0.0f;
Vector2 randomOffset = Random.insideUnitCircle * 0.1f;
Instantiate(
sparkEffectPrefab,
transform.position + new Vector3(randomOffset.x, randomOffset.y, 0),
Quaternion.identity
);
}
}
}
}
+2
View File
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 7af5b2b00cae60da5867ed21470d4d7f