From 51058a97a49bf16789010c8306909cbc5356785c Mon Sep 17 00:00:00 2001
From: wangguan <wangguan@kt007.com>
Date: Tue, 17 Nov 2020 18:32:52 +0800
Subject: [PATCH] 修改特效以及还原场景

---
 Assets/Scripts/TowerDefense/Towers/Placement/TowerPlacementGridEndless.cs |   29 +++++++++++++++--------------
 1 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/Assets/Scripts/TowerDefense/Towers/Placement/TowerPlacementGridEndless.cs b/Assets/Scripts/TowerDefense/Towers/Placement/TowerPlacementGridEndless.cs
index 0e51403..aba7633 100644
--- a/Assets/Scripts/TowerDefense/Towers/Placement/TowerPlacementGridEndless.cs
+++ b/Assets/Scripts/TowerDefense/Towers/Placement/TowerPlacementGridEndless.cs
@@ -37,7 +37,7 @@
         /// <summary>
         /// 等待购买开启对应按钮.
         /// </summary>
-        public Button waitBuyBtnPrefab;
+        public GameObject waitBuyBtnPrefab;
 
         /// <summary>
         /// 最后一行格子与前一行格子之间的空位长度.
@@ -629,27 +629,28 @@
             m_arrTGO = new EndlessTowerGridOpen[dimensions.x, dimensions.y];
 
             GameObject container = GameObject.Find("BuyButtonContainer");
-            float[] xup = { -0.6f, -0.3f, 0, 0.3f, 0.6f };
+            //float[] xup = { -0.6f, -0.3f, 0, 0.3f, 0.6f };
             for (int x = 0; x < dimensions.x; ++x)
             {
                 for (int y = dimensions.y - AttackRowNumbers; y < dimensions.y; ++y)
                 {
                     if (m_arrGridType[x, y] != PlacementGridType.EGridWaitBuy) continue;
 
-                    Button buyButton = Instantiate(waitBuyBtnPrefab);
+                    GameObject buyButton = Instantiate(waitBuyBtnPrefab);
                     buyButton.transform.SetParent(container.transform);
 
                     Vector3 pos = buyButton.transform.position;
-                    pos.x = arrGridCentPos[x, y].x + (x - 2) * gapArr[3 - y] + xup[x];
-
-                    if (y == 2)
-                    {
-                        pos.z = arrGridCentPos[x, y].y + 9f;
-                    }
-                    else if (y == 3)
-                    {
-                        pos.z = arrGridCentPos[x, y].y + 7f;
-                    }
+                    //pos.x = arrGridCentPos[x, y].x + (x - 2) * gapArr[3 - y] + xup[x];
+                    pos.x = arrGridCentPos[x, y].x + (x - 2) * gapArr[3 - y];
+                    pos.z = arrGridCentPos[x, y].y + 6f;
+                    // if (y == 2)
+                    // {
+                    //     pos.z = arrGridCentPos[x, y].y + 9f;
+                    // }
+                    // else if (y == 3)
+                    // {
+                    //     pos.z = arrGridCentPos[x, y].y + 7f;
+                    // }
                     pos.y = 30;
                     buyButton.transform.position = pos;
                     buyButton.transform.localRotation = Quaternion.identity;
@@ -774,7 +775,7 @@
 
                     arrTowerEnergyEffect[x, y] = Instantiate(energyEffectPrefab);
                     arrTowerEnergyEffect[x, y].transform.position = vpos;
-                    
+
                     // 创建水精灵充能条
                     img = Instantiate(FreezeBreathChargePrefab);
                     img.transform.SetParent(container.transform);

--
Gitblit v1.9.1