fixed: tambourine ui resets properly on player death
This commit is contained in:
@@ -41,7 +41,9 @@ public class PlayerBehavior : MonoBehaviour
|
||||
{ // initialize
|
||||
_rb = GetComponent<Rigidbody2D>();
|
||||
stateController = GameObject.Find("StateController").GetComponent<StateController>();
|
||||
|
||||
gameUI = GameObject.FindGameObjectWithTag("GameUICanvas").GetComponent<GameUIController>();
|
||||
gameUI.ResetInstrumentUI();
|
||||
|
||||
audioSource = this.gameObject.GetComponent<AudioSource>();
|
||||
audioSource.clip = footstepSound;
|
||||
@@ -235,8 +237,8 @@ public class PlayerBehavior : MonoBehaviour
|
||||
// destroy all tambourines
|
||||
GameObject[] currentTambourines = GameObject.FindGameObjectsWithTag("tambourine");
|
||||
foreach (GameObject tambourine in currentTambourines) {
|
||||
// tambourine.GetComponent<TambourineBehavior>().DestroySelf();
|
||||
Destroy(tambourine);
|
||||
tambourine.GetComponent<TambourineBehavior>().DestroySelf();
|
||||
// Destroy(tambourine);
|
||||
}
|
||||
|
||||
this.stateController.RespawnPlayer();
|
||||
|
||||
Reference in New Issue
Block a user