added some basic ui

still work in progress, just a progress commit!
This commit is contained in:
Sam
2023-05-01 16:05:41 -07:00
parent d1528cc6ff
commit febbf21253
11 changed files with 1577 additions and 292 deletions

View File

@@ -66,6 +66,8 @@ public class PlayerMovement : MonoBehaviour
[HideInInspector] private AudioSource audioSource;
[HideInInspector] private bool soundPlaying = false;
[HideInInspector] private GameUIController gameUI;
#endregion
private void Awake()
@@ -75,6 +77,7 @@ public class PlayerMovement : MonoBehaviour
grapplingRope = playerBehavior.grapplingRope;
stateController = GameObject.FindGameObjectWithTag("StateController").GetComponent<StateController>();
audioSource = GetComponent<AudioSource>();
gameUI = GameObject.FindGameObjectWithTag("GameUICanvas").GetComponent<GameUIController>();
}
private void Start()
@@ -135,6 +138,7 @@ public class PlayerMovement : MonoBehaviour
LastOnGroundTime = Data.coyoteTime; //if so sets the lastGrounded to coyoteTime
if (unlockedTrumpet) {
trumpet = 2;
gameUI.ToggleTrumpet(true);
} else {
trumpet = -1;
}
@@ -145,6 +149,7 @@ public class PlayerMovement : MonoBehaviour
if(!_isJumpFalling && !isRegFalling) {
if(unlockedTrumpet) {
trumpet = 1;
gameUI.ToggleTrumpet(true);
} else {
trumpet = -1;
}
@@ -302,6 +307,12 @@ public class PlayerMovement : MonoBehaviour
soundPlaying = false;
}
#endregion
#region UPDATE UI
if (trumpet == 0) {
gameUI.ToggleTrumpet(false);
}
#endregion
}
private void FixedUpdate()