From 6f16dfb8bcebe67aeb95ded0d8b644af4932e690 Mon Sep 17 00:00:00 2001
From: chenxin <chenxin6991@163.com>
Date: Mon, 26 Oct 2020 21:00:32 +0800
Subject: [PATCH] 无尽模式新手步骤到水元素放置塔位完成

---
 Assets/Scripts/TowerDefense/UI/HUD/EndlessRandomTower.cs |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/Assets/Scripts/TowerDefense/UI/HUD/EndlessRandomTower.cs b/Assets/Scripts/TowerDefense/UI/HUD/EndlessRandomTower.cs
index 35e5645..428c776 100644
--- a/Assets/Scripts/TowerDefense/UI/HUD/EndlessRandomTower.cs
+++ b/Assets/Scripts/TowerDefense/UI/HUD/EndlessRandomTower.cs
@@ -282,6 +282,8 @@
     /// </summary>
     public void onClick()
     {
+        if (GameConfig.IsNewbie && !GameConfig.CanBuyNewTower) return;
+
         // 还没到技能时间,忽略掉技能宝石
         Tower newTower = GetRandomTower(EndlessUIStart.instance.GameStartTime <= SKILL_TOWER_TIME);
 
@@ -295,7 +297,7 @@
     /// 随机找一个空白位置放置塔防
     /// </summary>
     /// <param name="tower"></param>
-    public bool RandomPlaceTower(Tower tower, int level = -1, int cost = -1)
+    public bool RandomPlaceTower(Tower tower, int level = -1, int cost = -1, int posx = - 1, int posy = -1)
     {
         EndlessGameUI gameUI = EndlessGameUI.instance;
 
@@ -303,9 +305,9 @@
             gameUI.CancelGhostPlacement();
 
         if (EndlessUIStart.instance.GameStartTime >= LEVELUP_TOWER_TIME)
-            return gameUI.RandomPlaceTower(tower, -1, -1, level == -1 ? 1 : level, cost);
+            return gameUI.RandomPlaceTower(tower, posx, posy, level == -1 ? 1 : level, cost);
         else
-            return gameUI.RandomPlaceTower(tower, -1, -1, level == -1 ? 0 : level, cost);
+            return gameUI.RandomPlaceTower(tower, posx, posy, level == -1 ? 0 : level, cost);
     }
 
     /// <summary>

--
Gitblit v1.9.1