fixed ui
also added the general game ui canvas to all scenes
This commit is contained in:
@@ -26,6 +26,7 @@ public class PlayerBehavior : MonoBehaviour
|
||||
[Header("Controllers:")]
|
||||
[SerializeField] private PlayerMovement playerController;
|
||||
[SerializeField] private StateController stateController;
|
||||
private GameUIController gameUI;
|
||||
|
||||
Animator animator;
|
||||
[HideInInspector] public bool playerIsAlive = true;
|
||||
@@ -40,6 +41,7 @@ public class PlayerBehavior : MonoBehaviour
|
||||
{ // initialize
|
||||
_rb = GetComponent<Rigidbody2D>();
|
||||
stateController = GameObject.Find("StateController").GetComponent<StateController>();
|
||||
gameUI = GameObject.FindGameObjectWithTag("GameUICanvas").GetComponent<GameUIController>();
|
||||
|
||||
audioSource = this.gameObject.GetComponent<AudioSource>();
|
||||
audioSource.clip = footstepSound;
|
||||
@@ -125,10 +127,15 @@ public class PlayerBehavior : MonoBehaviour
|
||||
if (unlockedTambourine && hasTambourine && !grapplingRope.isGrappling)
|
||||
{
|
||||
launcher.ThrowTambourine(forward);
|
||||
hasTambourine = false;
|
||||
SetHasTambourine(false);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetHasTambourine(bool state) {
|
||||
hasTambourine = state;
|
||||
gameUI.ToggleTambourine(state);
|
||||
}
|
||||
|
||||
void AttemptGrapple() {
|
||||
if (tambourine != null)
|
||||
{ // grapple to tambourine
|
||||
|
||||
Reference in New Issue
Block a user