chenxin
2020-12-11 fac697773b8cb65b3ab54569413e15fca03ad1d7
Assets/Scripts/TowerDefense/UI/HUD/PlacementTile.cs
@@ -1,7 +1,6 @@
using UnityEngine;
using TowerDefense.Level;
using UnityEditor;
using KTGMGemClient;
using Core.Utilities;
namespace TowerDefense.UI.HUD
{
@@ -65,6 +64,15 @@
        //public ParticleSystem myPS;//可以升级的特效
        public ParticleSystem myOpenPS;//购买后的特效
        public ParticleSystem myPutPS;//交换塔位置后的特效
        public GameObject myDragSelectPS;//推拽时候移动到当前塔的特效
        /// <summary>
        /// 所在的格子坐标
        /// </summary>
        public IntVector2 GridPosition { get; set; }
        /// <summary>
        /// Update the state of this placement tile
@@ -163,13 +171,28 @@
            {
                canPlaceRenderer.enabled = isOn;
            }
            if (myDragSelectPS.activeSelf != isOn)
            {
                myDragSelectPS.SetActive(isOn);
            }
            // if (isOn)
            // {
            //     myDragSelectPS.Play();
            // }
            // else
            // {
            //     myDragSelectPS.Stop();
            // }
            if (isOn && towerName != "")
            {
                SetTowerVirtualshadow(towerName);
                EndlessWaveLineManager.instance.SetWaveLineShow(GridPosition.x, true);
            }
            else if (!isOn && towerVSRenderer.enabled)
            {
                towerVSRenderer.enabled = false;
                EndlessWaveLineManager.instance.SetWaveLineShow(GridPosition.x, false);
            }
        }
@@ -255,6 +278,7 @@
                        tileRenderer.sharedMaterial = waitBuyMat;
                    break;
                case PlacementGridType.EGridOpen:
                    //Debug.Log("开了塔" + EndlessLevelManager.instanceExists);
                    if (EndlessLevelManager.instanceExists)
                    {
                        tileRenderer.enabled = false;
@@ -271,5 +295,16 @@
                    break;
            }
        }
        public void BuyPs()
        {
            myOpenPS?.Play();
        }
        public void PutPs()
        {
            myPutPS?.Play();
        }
    }
}