miepzerino
2023-12-19 61930cf21d3eb145df11ea2b719ae7be66c56d24
Assets/Scripts/Managers/UIManager.cs
@@ -9,7 +9,8 @@
{
    public GameObject damageTextPrefab;
    public GameObject healthTextPrefab;
    public Canvas gameCanvas;
    public Canvas playerUI;
    public Canvas pauseMenuUI;
    private void OnEnable()
    {
@@ -31,7 +32,7 @@
        // Create damage text at character
        Vector3 spawnPosition = Camera.main.WorldToScreenPoint(character.transform.position);
        TMP_Text tmpText = Instantiate(damageTextPrefab, spawnPosition, Quaternion.identity, gameCanvas.transform).GetComponent<TMP_Text>();
        TMP_Text tmpText = Instantiate(damageTextPrefab, spawnPosition, Quaternion.identity, pauseMenuUI.transform).GetComponent<TMP_Text>();
        tmpText.text = damageReceived.ToString();
@@ -41,9 +42,13 @@
        // Create heal text at character
        Vector3 spawnPosition = Camera.main.WorldToScreenPoint(character.transform.position);
        TMP_Text tmpText = Instantiate(healthTextPrefab, spawnPosition, Quaternion.identity, gameCanvas.transform).GetComponent<TMP_Text>();
        TMP_Text tmpText = Instantiate(healthTextPrefab, spawnPosition, Quaternion.identity, pauseMenuUI.transform).GetComponent<TMP_Text>();
        tmpText.text = healthRestored.ToString();
    }
    public void GameLoaded()
    {
        pauseMenuUI.GetComponent<Animator>().SetTrigger("GameLoaded");
    }
}