|
@@ -2,6 +2,7 @@ using System.Collections;
|
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
|
using UnityEngine;
|
|
using UnityEngine;
|
|
|
using static Spine.Unity.Examples.SpineboyFootplanter;
|
|
using static Spine.Unity.Examples.SpineboyFootplanter;
|
|
|
|
|
+using TMPro;
|
|
|
|
|
|
|
|
public class Tower : Character
|
|
public class Tower : Character
|
|
|
{
|
|
{
|
|
@@ -117,6 +118,20 @@ public class Tower : Character
|
|
|
public override void BeHit(int damage, Vector3 force, bool changeHurt, float repelValue)
|
|
public override void BeHit(int damage, Vector3 force, bool changeHurt, float repelValue)
|
|
|
{
|
|
{
|
|
|
hp -= damage;
|
|
hp -= damage;
|
|
|
|
|
+
|
|
|
|
|
+ //É˺¦Ìø×Ö
|
|
|
|
|
+ if (showInjuryNum)
|
|
|
|
|
+ {
|
|
|
|
|
+ GameObject injuryNum = Instantiate(injuryNumText);
|
|
|
|
|
+ injuryNum.transform.position = new Vector3(transform.position.x + Random.Range(-1f, 1f), transform.position.y + 1, transform.position.z);
|
|
|
|
|
+ TextMeshProUGUI text = injuryNum.GetComponentInChildren<TextMeshProUGUI>();
|
|
|
|
|
+ text.text = damage.ToString();
|
|
|
|
|
+ if (gameObject.CompareTag("Player"))
|
|
|
|
|
+ {
|
|
|
|
|
+ text.color = Color.red;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
uiHp.Show(hp, totalHp);
|
|
uiHp.Show(hp, totalHp);
|
|
|
if (hp <= 0)
|
|
if (hp <= 0)
|
|
|
{
|
|
{
|