Pārlūkot izejas kodu

保护罩套多层盾

WGL 1 mēnesi atpakaļ
vecāks
revīzija
3b7b54bab8

+ 4 - 1
ActionTowerDefense/Assets/Resources/Prefab/Conduct/Photosphere.prefab

@@ -27,7 +27,7 @@ Transform:
   m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
   m_LocalPosition: {x: 0, y: 0, z: 0}
   m_LocalScale: {x: 1, y: 1, z: 1}
-  m_ConstrainProportionsScale: 0
+  m_ConstrainProportionsScale: 1
   m_Children:
   - {fileID: 8283194513254342148}
   - {fileID: 7905728122997361441}
@@ -47,9 +47,12 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   conductController: {fileID: 0}
+  haveStayTime: 1
   stayTime: 10
   breakEffect: {fileID: 417478504669294145, guid: 2a4e7e280b9d19042ba0f57ae5edf736, type: 3}
+  offset: 0.2
   hp: 0
+  id: 0
   bulletPrefab: {fileID: 7473170563405908938, guid: 78ed8700e43860e48b7bd70b4cbc14d3, type: 3}
   rate: 1
 --- !u!1 &1373031044951819773

+ 10 - 0
ActionTowerDefense/Assets/Scripts/Conduct/ConductController.cs

@@ -157,6 +157,7 @@ public class ConductController : MonoBehaviour
                 photosphere.conductController = this;
                 photosphere.id = photospheres.Count;
                 photospheres.Add(photosphere);
+                RefreshBarrierScale();
                 break;
             case ConductSkills.SpiritBloodAggregator:
                 ConductManager.SpiritBloodAggregator spiritBloodAggregator = conductManager.spiritBloodAggregator;
@@ -198,4 +199,13 @@ public class ConductController : MonoBehaviour
                 break;
         }
     }
+
+    public void RefreshBarrierScale()
+    {
+        for(int i = 0; i < photospheres.Count; i++)
+        {
+            Photosphere photosphere = photospheres[i];
+            photosphere.transform.localScale = (1 + i * photosphere.offset) * Vector3.one;
+        }
+    }
 }

+ 3 - 0
ActionTowerDefense/Assets/Scripts/Conduct/Photosphere.cs

@@ -12,6 +12,7 @@ public class Photosphere : MonoBehaviour
     [ShowIf("haveStayTime")][LabelText("停留时间")]public float stayTime;
     [LabelText("破碎特效")]public GameObject breakEffect;
     private float time;
+    [LabelText("大小差值")] public float offset;
     public int hp;
     public int id;
     public GameObject bulletPrefab;
@@ -24,6 +25,7 @@ public class Photosphere : MonoBehaviour
             conductController.photospheres.Remove(this);
             Transform trans = PoolManager.Instantiate(breakEffect).transform;
             trans.position = transform.position;
+            conductController.RefreshBarrierScale();
             gameObject.SetActive(false);
         }
         if (haveStayTime)
@@ -32,6 +34,7 @@ public class Photosphere : MonoBehaviour
             if (time >= stayTime)
             {
                 conductController.photospheres.Remove(this);
+                conductController.RefreshBarrierScale();
                 gameObject.SetActive(false);
             }
         }