ACTUALLY FIXED BROKEN COMMIT
pull this one!
This commit is contained in:
parent
071a9b43d4
commit
fc8c2e6062
@ -18,12 +18,16 @@ public class GameUIController : MonoBehaviour
|
||||
private StateController stateController;
|
||||
|
||||
void Start() {
|
||||
stateController = GameObject.FindGameObjectWithTag("StateController").GetComponent<StateController>();
|
||||
if (stateController == null) {
|
||||
print("state controller not found");
|
||||
} else {
|
||||
print("yeehaw");
|
||||
}
|
||||
trumpetUI = trumpetBackground.transform.GetChild(0).gameObject;
|
||||
tambourineUI = tambourineBackground.transform.GetChild(0).gameObject;
|
||||
clarinetUI = clarinetBackground.transform.GetChild(0).gameObject;
|
||||
|
||||
stateController = GameObject.FindGameObjectWithTag("StateController").GetComponent<StateController>();
|
||||
|
||||
if (!stateController.unlockedTrumpet) {
|
||||
trumpetBackground.SetActive(false);
|
||||
}
|
||||
@ -57,6 +61,9 @@ public class GameUIController : MonoBehaviour
|
||||
}
|
||||
|
||||
public void ResetInstrumentUI() {
|
||||
if (stateController == null) {
|
||||
print("state controller null");
|
||||
}
|
||||
if (stateController.unlockedTrumpet) {
|
||||
ToggleTrumpet(true);
|
||||
}
|
||||
|
@ -37,13 +37,12 @@ public class PlayerBehavior : MonoBehaviour
|
||||
AudioSource audioSource;
|
||||
|
||||
|
||||
void Start()
|
||||
void Awake()
|
||||
{ // 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;
|
||||
@ -54,6 +53,10 @@ public class PlayerBehavior : MonoBehaviour
|
||||
playerIsAlive = true;
|
||||
}
|
||||
|
||||
void Start() {
|
||||
gameUI.ResetInstrumentUI();
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
unlockedTambourine = stateController.unlockedTambourine;
|
||||
|
Loading…
Reference in New Issue
Block a user