Backup
This commit is contained in:
@@ -11,6 +11,8 @@ private EdgeCollider2D edge;
|
||||
public float fadeTime;
|
||||
public float refractoryTime;
|
||||
private bool gone;
|
||||
private AudioSource audioSource; // Reference to the AudioSource component
|
||||
public AudioClip fadeSound; // The sound clip to be played
|
||||
|
||||
|
||||
void Start()
|
||||
@@ -19,6 +21,7 @@ private bool gone;
|
||||
col = GetComponent<BoxCollider2D>();
|
||||
edge = GetComponent<EdgeCollider2D>();
|
||||
gone = false;
|
||||
audioSource = GetComponent<AudioSource>();
|
||||
}
|
||||
|
||||
void Update()
|
||||
@@ -51,6 +54,7 @@ private bool gone;
|
||||
col.enabled = false;
|
||||
edge.enabled = false;
|
||||
gone = true;
|
||||
audioSource.PlayOneShot(fadeSound);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user