Ver Fonte

跳字开关

LAPTOP-OM1V99U2\永远de小亡灵 há 1 ano atrás
pai
commit
283e8d27a8

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

@@ -1559,7 +1559,7 @@ PrefabInstance:
       objectReference: {fileID: 0}
     - target: {fileID: 262311660969425103, guid: 12435a63399f44f4a919a57010981786, type: 3}
       propertyPath: m_LocalPosition.y
-      value: 0.81
+      value: 0.733
       objectReference: {fileID: 0}
     - target: {fileID: 262311660969425103, guid: 12435a63399f44f4a919a57010981786, type: 3}
       propertyPath: m_LocalPosition.z

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

@@ -15607,6 +15607,8 @@ MonoBehaviour:
   canNotAddForce: 0
   canNotChangeHurt: 0
   invincibleTime: 0
+  injuryNumText: {fileID: 0}
+  showInjuryNum: 0
   totalDieKeepTime: 2
   dieKeepTime: 0
   canHitFly: 0
@@ -15744,6 +15746,8 @@ MonoBehaviour:
   canNotAddForce: 0
   canNotChangeHurt: 0
   invincibleTime: 0
+  injuryNumText: {fileID: 0}
+  showInjuryNum: 0
   totalDieKeepTime: 2
   dieKeepTime: 0
   canHitFly: 0
@@ -27159,6 +27163,8 @@ MonoBehaviour:
   canNotAddForce: 0
   canNotChangeHurt: 0
   invincibleTime: 0
+  injuryNumText: {fileID: 0}
+  showInjuryNum: 0
   totalDieKeepTime: 2
   dieKeepTime: 0
   canHitFly: 0
@@ -27408,6 +27414,8 @@ MonoBehaviour:
   canNotAddForce: 1
   canNotChangeHurt: 1
   invincibleTime: 0
+  injuryNumText: {fileID: 0}
+  showInjuryNum: 1
   totalDieKeepTime: 2
   dieKeepTime: 0
   canHitFly: 0
@@ -27489,6 +27497,10 @@ MonoBehaviour:
   haveTransmit: 0
   transmitTime: 0
   portalsController: {fileID: 0}
+  isSustainedInjury: 0
+  sustainedInjuryTime: 0
+  sustainedInjury_IntervalTime: 0
+  sustainedInjury_damage: 0
   states:
   - coreHp: 3000
     scale: 1

+ 1 - 0
ActionTowerDefense/Assets/Resources/Prefab/ESpirits_Assassin.prefab

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

+ 1 - 0
ActionTowerDefense/Assets/Resources/Prefab/ESpirits_Cook.prefab

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

+ 1 - 0
ActionTowerDefense/Assets/Resources/Prefab/ESpirits_Float.prefab

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

+ 1 - 0
ActionTowerDefense/Assets/Resources/Prefab/ESpirits_Invisible.prefab

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

+ 1 - 0
ActionTowerDefense/Assets/Resources/Prefab/EnemyTower.prefab

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

+ 1 - 0
ActionTowerDefense/Assets/Resources/Prefab/Enemy_Arrow.prefab

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

+ 1 - 0
ActionTowerDefense/Assets/Resources/Prefab/Enemy_Giant.prefab

@@ -451,6 +451,7 @@ MonoBehaviour:
   canNotChangeHurt: 0
   invincibleTime: 0
   injuryNumText: {fileID: 6467251191553420251, guid: 9b37289f93ea76745ab2cefb79a93e3c, type: 3}
+  showInjuryNum: 1
   totalDieKeepTime: 5
   dieKeepTime: 0
   canHitFly: 1

+ 1 - 0
ActionTowerDefense/Assets/Resources/Prefab/Enemy_Sword.prefab

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

+ 1 - 0
ActionTowerDefense/Assets/Resources/Prefab/Player.prefab

@@ -782,6 +782,7 @@ MonoBehaviour:
   canNotChangeHurt: 0
   invincibleTime: 0
   injuryNumText: {fileID: 6467251191553420251, guid: 9b37289f93ea76745ab2cefb79a93e3c, type: 3}
+  showInjuryNum: 1
   totalDieKeepTime: 0.3
   dieKeepTime: 0
   canHitFly: 1

+ 11 - 7
ActionTowerDefense/Assets/Scripts/Character.cs

@@ -83,6 +83,7 @@ public class Character : MonoBehaviour
     [HideInInspector]
     public float invincibleTime;    //无敌时间
     public GameObject injuryNumText;//伤害跳字
+    public bool showInjuryNum;      //伤害跳字开关
 
     [Header("死亡后多久尸体消失")]
     public float totalDieKeepTime = 2f;
@@ -213,15 +214,18 @@ public class Character : MonoBehaviour
 
         //非无敌状态扣血
         hp -= damage;
-        
+
         //伤害跳字
-        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"))
+        if (showInjuryNum)
         {
-            text.color = Color.red;
+            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);