Bladeren bron

玉门关更新

SZAND\msx_2 1 jaar geleden
bovenliggende
commit
7fbcdd5424

File diff suppressed because it is too large
+ 439 - 350
ActionTowerDefense/Assets/Resources/Prefab/Boss/YuMenGuan/Boss_YuMenGuan.prefab


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

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 036405374a9f18043ad17d1f9878eb95
+guid: 07f367ccb2935b5419f12e47196b0a49
 PrefabImporter:
   externalObjects: {}
   userData: 

File diff suppressed because it is too large
+ 821 - 127
ActionTowerDefense/Assets/Scenes/SampleScene.unity


+ 23 - 2
ActionTowerDefense/Assets/Scripts/Boss/Boss.cs

@@ -67,8 +67,8 @@ public class Boss : MoveCharacter
         curState = states[curStateId];
         toLargeSize = curState.scale;
         beLarger = true;
-        CalculateHp();
         ChangeWeakness();
+        CalculateHp();
     }
 
     //切换弱点
@@ -82,13 +82,33 @@ public class Boss : MoveCharacter
             w.totalHp = ws[i].Hp;
             w.boss = this;
             ws[i].obj.SetActive(true);
+            ws[i].obj.GetComponentInChildren<ParticleSystem>().Play();
+        }
+    }
+
+    public override void Init()
+    {
+        //确保组件不丢失
+        if (!ani)
+        {
+            ani = GetComponentInChildren<Animator>();
         }
+
+        //血量重置
+        hp = totalHp;
+        uiHp.Show(hp, totalHp);
+        ChangeState(CharacterState.Idle);
+    }
+
+    private void Awake()
+    {
+        
     }
 
     public void Start()
     {
         ChangeBossState();
-        base.Init();
+        Init();
         maxStateId = states.Length - 1;
     }
 
@@ -125,6 +145,7 @@ public class Boss : MoveCharacter
             coreWeakness.boss = this;
             coreWeakness.isCore = true;
             curState.core.SetActive(true);
+            curState.core.GetComponentInChildren<ParticleSystem>().Play();
         }
     }
 

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

@@ -8,6 +8,11 @@ public class Weakness : Character
     public Boss boss;
     public bool isCore;
 
+    private void OnEnable()
+    {
+        hp = totalHp;
+    }
+
     private void Start()
     {
         hp = totalHp;

+ 1 - 1
ActionTowerDefense/Assets/Scripts/Character.cs

@@ -366,7 +366,7 @@ public class Character : MonoBehaviour
     public void Enlarge()
     {
         transform.localScale = Vector3.SmoothDamp(transform.localScale, new Vector3(1, 1, 1) * (toLargeSize + 0.1f), ref speed, 0.4f);
-        if (transform.localScale.x >= toLargeSize + 0.05f)
+        if (transform.localScale.x >= toLargeSize)
         {
             beLarger = false;
             transform.localScale = new Vector3(toLargeSize, toLargeSize, 1);

+ 1 - 2
ActionTowerDefense/Assets/Scripts/EnemyCreater.cs

@@ -144,8 +144,7 @@ public class EnemyCreater : MonoBehaviour
         GameObject enemyObj = Util.Instantiate(cfgEnemy.EnemyPrefab, pos);
         if (enemyId > 1000)
         {
-            Boss boss = enemyObj.GetComponent<Boss>();
-            boss.Init();
+            Boss boss = enemyObj.GetComponentInChildren<Boss>();
         }
         else
         {

+ 17 - 0
ActionTowerDefense/ProjectSettings/BurstAotSettings_StandaloneWindows.json

@@ -0,0 +1,17 @@
+{
+  "MonoBehaviour": {
+    "Version": 4,
+    "EnableBurstCompilation": true,
+    "EnableOptimisations": true,
+    "EnableSafetyChecks": false,
+    "EnableDebugInAllBuilds": false,
+    "UsePlatformSDKLinker": false,
+    "CpuMinTargetX32": 0,
+    "CpuMaxTargetX32": 0,
+    "CpuMinTargetX64": 0,
+    "CpuMaxTargetX64": 0,
+    "CpuTargetsX32": 6,
+    "CpuTargetsX64": 72,
+    "OptimizeFor": 0
+  }
+}

+ 6 - 0
ActionTowerDefense/ProjectSettings/CommonBurstAotSettings.json

@@ -0,0 +1,6 @@
+{
+  "MonoBehaviour": {
+    "Version": 4,
+    "DisabledWarnings": ""
+  }
+}

Some files were not shown because too many files changed in this diff