| | |
| | | { |
| | | public GameObject damageTextPrefab; |
| | | public GameObject healthTextPrefab; |
| | | public Canvas gameCanvas; |
| | | public Canvas playerUI; |
| | | public Canvas pauseMenuUI; |
| | | |
| | | private void OnEnable() |
| | | { |
| | |
| | | // 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(); |
| | | |
| | |
| | | // 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"); |
| | | } |
| | | } |