LAPTOP-OM1V99U2\永远de小亡灵 1 жил өмнө
parent
commit
1f27135ae3

+ 2 - 1
ActionTowerDefense/Assets/Resources/Prefab/Boss/YuMenGuan/Block/Block.prefab

@@ -242,7 +242,8 @@ MonoBehaviour:
   canNotAddForce: 0
   canNotChangeHurt: 0
   invincibleTime: 0
-  injuryNumText: {fileID: 0}
+  injuryNumText: {fileID: 6467251191553420251, guid: 9b37289f93ea76745ab2cefb79a93e3c, type: 3}
+  showInjuryNum: 1
   totalDieKeepTime: 2.1
   dieKeepTime: 0
   canHitFly: 0

+ 3 - 3
ActionTowerDefense/Assets/Resources/Prefab/Boss/YuMenGuan/Boss_YuMenGuan.prefab

@@ -15746,8 +15746,8 @@ MonoBehaviour:
   canNotAddForce: 0
   canNotChangeHurt: 0
   invincibleTime: 0
-  injuryNumText: {fileID: 0}
-  showInjuryNum: 0
+  injuryNumText: {fileID: 6467251191553420251, guid: 9b37289f93ea76745ab2cefb79a93e3c, type: 3}
+  showInjuryNum: 1
   totalDieKeepTime: 2
   dieKeepTime: 0
   canHitFly: 0
@@ -27414,7 +27414,7 @@ MonoBehaviour:
   canNotAddForce: 1
   canNotChangeHurt: 1
   invincibleTime: 0
-  injuryNumText: {fileID: 0}
+  injuryNumText: {fileID: 6467251191553420251, guid: 9b37289f93ea76745ab2cefb79a93e3c, type: 3}
   showInjuryNum: 1
   totalDieKeepTime: 2
   dieKeepTime: 0

+ 15 - 0
ActionTowerDefense/Assets/Scripts/Boss/Boss.cs

@@ -3,6 +3,7 @@ using Spine;
 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
+using TMPro;
 
 public enum AttackState
 {
@@ -154,6 +155,20 @@ public class Boss : MoveCharacter
             damage *= coreDamageRate;
         }
         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);
         if (hp <= 0)
         {

+ 15 - 0
ActionTowerDefense/Assets/Scripts/Boss/Weakness.cs

@@ -1,6 +1,7 @@
 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
+using TMPro;
 
 public class Weakness : Character
 {
@@ -26,6 +27,20 @@ public class Weakness : Character
             if (!isCore)
             {
                 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;
+                    }
+                }
+
                 if (hp <= 0)
                 {
                     ChangeState(CharacterState.Die);

+ 15 - 0
ActionTowerDefense/Assets/Scripts/Boss/YuMenGuan/Block.cs

@@ -1,6 +1,7 @@
 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
+using TMPro;
 
 public class Block : Character
 {
@@ -151,6 +152,20 @@ public class Block : Character
         else
         {
             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;
+                }
+            }
+
             if (hp <= 0)
             {
                 ChangeState(CharacterState.Die);

+ 15 - 0
ActionTowerDefense/Assets/Scripts/EnemyTower.cs

@@ -1,6 +1,7 @@
 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
+using TMPro;
 
 public class EnemyTower : Character
 {
@@ -115,6 +116,20 @@ public class EnemyTower : Character
     public override void BeHit(int damage, Vector3 force, bool changeHurt, float repelValue)
     {
         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);
         if (hp <= 0)
         {

+ 15 - 0
ActionTowerDefense/Assets/Scripts/Tower.cs

@@ -2,6 +2,7 @@ using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using static Spine.Unity.Examples.SpineboyFootplanter;
+using TMPro;
 
 public class Tower : Character
 {
@@ -117,6 +118,20 @@ public class Tower : Character
     public override void BeHit(int damage, Vector3 force, bool changeHurt, float repelValue)
     {
         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);
         if (hp <= 0)
         {

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 61 - 9
ActionTowerDefense/Assets/TextMesh Pro/Resources/Fonts & Materials/思源黑体SC-Heavy SDF.asset


Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно