| | |
| | | using Core.Health; |
| | | using System.Globalization; |
| | | using Core.Health; |
| | | using Core.Input; |
| | | using Core.Utilities; |
| | | using DG.Tweening; |
| | |
| | | /// </summary> |
| | | public Button randomTowerBtn; |
| | | |
| | | public Button SkillTowerBtn; |
| | | |
| | | /// <summary> |
| | | /// 飘血数字对应的prefab. |
| | | /// </summary> |
| | |
| | | /// 购买塔防按钮上的Text. |
| | | /// </summary> |
| | | protected TextMeshProUGUI towerPriceText; |
| | | |
| | | protected TextMeshProUGUI towerPriceText1; |
| | | |
| | | protected bool tdBuyDisable = false; |
| | | |
| | |
| | | /// Current tower placeholder. Will be null if not in the <see cref="State.Building" /> state. |
| | | /// </summary> |
| | | TowerPlacementGhost m_CurrentTower; |
| | | |
| | | public bool HasTower |
| | | { |
| | | get |
| | | { |
| | | return m_CurrentTower != null; |
| | | } |
| | | } |
| | | |
| | | // TowerList用于简单记录相关的数据 |
| | | protected List<Tower> m_listTower = new List<Tower>(); |
| | |
| | | /// </summary> |
| | | public GameObject TowerAppearEffectPrefab; |
| | | |
| | | public GameObject TowerUpgradeEffectPrefabGuide;//新手导航特效Layer是UI |
| | | public GameObject TowerAppearEffectPrefabGuide;//新手导航特效Layer是UI |
| | | |
| | | |
| | | //首次购买宝石特效 |
| | | public GameObject fireAppearEffect1; |
| | | public GameObject fireAppearEffect2; |
| | | |
| | | public GameObject waterAppearEffect1; |
| | | public GameObject waterAppearEffect2; |
| | | public GameObject woodAppearEffect1; |
| | | public GameObject woodAppearEffect2; |
| | | /// <summary> |
| | | /// 保存所有生成或合成的塔的最小等级,索引0 -> 火木水塔 索引1 -> 技能塔 |
| | | /// 保存所有生成或合成的塔的最小等级 |
| | | /// </summary> |
| | | /// <value></value> |
| | | public int MinLevel; |
| | |
| | | UIPointer pointer = WrapPointer(pinfo); |
| | | Tower sTower = PickTowerInGrid(pointer); |
| | | if (sTower != null) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | if ((m_GridPosition.x >= 0) && (m_GridPosition.y >= 0)) |
| | | { |
| | | if (m_CurrentArea.isFreeAtackPos(m_GridPosition.x, m_GridPosition.y)) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | return false; |
| | |
| | | /// <param name="tower"></param> |
| | | protected void growUpTower(Tower tower) |
| | | { |
| | | Tower newTower = EndlessRandomTower.instance.GetRandomTower(false); |
| | | Tower newTower = EndlessRandomTower.instance.GetRandomTower(EFeatureTower.NULL, true); |
| | | |
| | | // 所有的Tower不能升级成为FeatureTower. |
| | | int maxLoop = 20; |
| | | while (newTower.towerFeature != EFeatureTower.NULL) |
| | | { |
| | | newTower = EndlessRandomTower.instance.GetRandomTower(false); |
| | | newTower = EndlessRandomTower.instance.GetRandomTower(EFeatureTower.NULL, true); |
| | | maxLoop--; |
| | | if (maxLoop <= 0) |
| | | { |
| | |
| | | { |
| | | // 清理技能 |
| | | EndlessBossSkillManager.instance.ClearSkillList(); |
| | | EndlessBossHPManager.instance.SwitchHP(true); |
| | | EndlessBossHPManager.instance.SetCurrentHP(0); |
| | | |
| | | // 停止所有兵线的出兵 |
| | | for (int i = 0; i < TotalWaveLines; ++i) |
| | |
| | | overTimer = null; |
| | | } |
| | | |
| | | #region 拖动时候给塔位一个标识 |
| | | |
| | | public MeshRenderer temporaryMat;//移动时候的虚像材质 |
| | | |
| | | /// <summary> |
| | | /// 查找可以合成的塔 |
| | | /// </summary> |
| | | public void CheckAllCanPlace() |
| | | { |
| | | if (m_CurrentTower != null) |
| | | { |
| | | if (m_CurrentTower.controller.towerFeature == EFeatureTower.NULL) |
| | | { |
| | | List<IntVector2> allTowerP = null;//排除不能合成的 |
| | | // List<IntVector2> allPSTowerP = new List<IntVector2>();//需要播放升级动画的 |
| | | |
| | | if (towerToMove) |
| | | { |
| | | if (towerToMove.gridPosition.y == 0 || towerToMove.gridPosition.y == 1) |
| | | { |
| | | allTowerP = new List<IntVector2>(); |
| | | for (int i = 0; i < m_listTower.Count; i++) |
| | | { |
| | | if (m_listTower[i].bInAttackMode && towerToMove && m_listTower[i].currentLevel == dragTowerLevel && m_listTower[i].towerName == towerToMove.towerName) |
| | | { |
| | | // if (towerToMove.gridPosition != m_listTower[i].gridPosition) |
| | | // //说明可以合成 |
| | | // allPSTowerP.Add(m_listTower[i].gridPosition); |
| | | } |
| | | else |
| | | { |
| | | //把不符合条件的传进去 |
| | | allTowerP.Add(m_listTower[i].gridPosition); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | if (m_CurrentArea != null) |
| | | { |
| | | //修改为只要开启格子都可以放 |
| | | (m_CurrentArea as TowerPlacementGridEndless).CheckAllCanPlace(allTowerP); |
| | | //(m_CurrentArea as TowerPlacementGridEndless).PlayPS(allPSTowerP); |
| | | } |
| | | |
| | | } |
| | | else if (m_CurrentTower.controller.towerFeature == EFeatureTower.Skill_Fire || m_CurrentTower.controller.towerFeature == EFeatureTower.Skill_Bomb) |
| | | { |
| | | //Debug.Log("需要激活兵线下方绿色标识"); |
| | | EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.EndlessStartDragSkill, true); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 关闭所有标识 |
| | | /// </summary> |
| | | public void CloseCanPlaceRenderer() |
| | | { |
| | | if (m_CurrentTower && m_CurrentTower.controller && m_CurrentTower.controller.towerFeature == EFeatureTower.Skill_Fire || m_CurrentTower.controller.towerFeature == EFeatureTower.Skill_Bomb) |
| | | { |
| | | EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.EndlessStartDragSkill, false); |
| | | } |
| | | |
| | | if (m_CurrentArea != null) |
| | | (m_CurrentArea as TowerPlacementGridEndless).CloseCanPlaceRenderer(); |
| | | else |
| | | { |
| | | GameObject placeObj = GameObject.FindGameObjectWithTag("PlaceTower"); |
| | | if (placeObj != null) |
| | | (placeObj.GetComponent<IPlacementArea>() as TowerPlacementGridEndless).CloseCanPlaceRenderer(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 检查符合条件的塔 |
| | | /// </summary> |
| | | /// <param name="pointerInfo"></param> |
| | | public void CheckTowerPlace(PointerInfo pointerInfo) |
| | | { |
| | | //return; |
| | | if (m_CurrentArea != null && m_CurrentArea is TowerPlacementGridEndless) |
| | | { |
| | | //下面是为了设置一个虚拟的塔 |
| | | if (isFreeAttackGridOnDrag(pointerInfo) && m_CurrentTower.controller.towerFeature == EFeatureTower.NULL) |
| | | { |
| | | //Debug.Log("得到了一个空的塔位"); |
| | | |
| | | (m_CurrentArea as TowerPlacementGridEndless).CheckCanPlaceUpdate(m_GridPosition.x, m_GridPosition.y, false, ""); |
| | | //if(temporaryMat) |
| | | } |
| | | else if ((m_GridPosition.x >= 0) && (m_GridPosition.y >= 0)) |
| | | { |
| | | if (m_CurrentArea.isFreeAtackPos(m_GridPosition.x, m_GridPosition.y)) |
| | | { |
| | | (m_CurrentArea as TowerPlacementGridEndless).CheckCanPlaceUpdate(m_GridPosition.x, m_GridPosition.y, true, towerToMove.towerName); |
| | | } |
| | | else |
| | | { |
| | | (m_CurrentArea as TowerPlacementGridEndless).CloseCanPlace(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | (m_CurrentArea as TowerPlacementGridEndless).CloseCanPlace(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //Debug.Log("什么情况"); |
| | | if (m_CurrentTower.controller.towerFeature == EFeatureTower.NULL) |
| | | { |
| | | dragTowerPlacement.CloseCanPlace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | TowerPlacementGridEndless dragTowerPlacement; |
| | | |
| | | /// <summary> |
| | | /// 目标位置是否是可攻击属性的空塔位 |
| | | /// </summary> |
| | | /// <param name="pinfo"></param> |
| | | /// <returns></returns> |
| | | protected bool isFreeAttackGridOnDrag(PointerInfo pinfo) |
| | | { |
| | | // 判断格子上的塔防: |
| | | UIPointer pointer = WrapPointer(pinfo); |
| | | Tower sTower = PickTowerInGrid(pointer); |
| | | if (sTower != null) |
| | | { |
| | | if (sTower.bInAttackMode && towerToMove && sTower.currentLevel == dragTowerLevel && sTower.towerName == towerToMove.towerName) |
| | | { |
| | | //说明可以合成 |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | return false; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 拖动一个Tower之后,松开鼠标或者EndDrag. |
| | | /// 1: 目标点可合成,则直接合成。 |
| | |
| | | public void onEndTowerDrag(PointerInfo pointerInfo) |
| | | { |
| | | bool bSkill = false; |
| | | if (temporaryMat != null) |
| | | { |
| | | //移动虚像隐藏 |
| | | temporaryMat.material = null; |
| | | } |
| | | |
| | | if (!m_CurrentTower || !m_CurrentTower.controller) |
| | | { |
| | | CancelPlaceTower(pointerInfo); |
| | |
| | | |
| | | // 判断目标位置是否有Tower且类型和等级一致,如果没有,则GhostTower删除,原Tower显示。 |
| | | if (isValidateCombineTarget(pointerInfo)) |
| | | { |
| | | TryPlaceTower(pointerInfo); |
| | | EndlessRandomTower.instance.UpdateDescDisplay(); |
| | | } |
| | | else if (isFreeAttackGrid(pointerInfo) && !bSkill) |
| | | { |
| | | if (!TryPlaceTower(pointerInfo, false, true)) return; |
| | | if (!TryPlaceTower(pointerInfo, false, true)) |
| | | { |
| | | CancelPlaceTower(pointerInfo); |
| | | |
| | | Debug.Log("这里需要返回原位"); |
| | | return; |
| | | } |
| | | |
| | | // 删除towerToMove,确保塔防数据不再出现多个 |
| | | if (towerToMove != null) |
| | |
| | | /// <param name="worldPos"></param> |
| | | public void PlayUpgradeEffect(Tower newTower) |
| | | { |
| | | GameObject effect = TowerUpgradeEffectPrefab; |
| | | newTower.currentTowerLevel.PlayUpGradeEffect(); |
| | | // GameObject effect = TowerUpgradeEffectPrefab; |
| | | |
| | | if (newTower.towerFeature == EFeatureTower.NULL) |
| | | { |
| | | string path = $"UI/ToBattle_{newTower.attributeId}"; |
| | | GameObject prefab = Resources.Load<GameObject>(path); |
| | | effect = Instantiate(prefab); |
| | | } |
| | | // if (newTower.towerFeature == EFeatureTower.NULL) |
| | | // { |
| | | // string path = $"UI/ToBattle_{newTower.attributeId}"; |
| | | // GameObject prefab = Resources.Load<GameObject>(path); |
| | | // effect = Instantiate(prefab); |
| | | // } |
| | | |
| | | // 在sTower的位置播放升级特效 |
| | | GameObject obj = Instantiate(effect); |
| | | obj.transform.position = newTower.transform.position; |
| | | Vector3 pos = obj.transform.position; |
| | | pos.y += 5f; |
| | | obj.transform.position = pos; |
| | | ParticleSystem ps = obj.GetComponent<ParticleSystem>(); |
| | | // // 在sTower的位置播放升级特效 |
| | | // GameObject obj = Instantiate(effect); |
| | | // obj.transform.position = newTower.transform.position; |
| | | // Vector3 pos = obj.transform.position; |
| | | // pos.y += 5f; |
| | | // obj.transform.position = pos; |
| | | // ParticleSystem ps = obj.GetComponent<ParticleSystem>(); |
| | | |
| | | if (ps == null) |
| | | ps = obj.transform.GetChild(0).GetComponent<ParticleSystem>(); |
| | | ps.Play(); |
| | | Destroy(obj, ps.main.duration); |
| | | // if (ps == null) |
| | | // ps = obj.transform.GetChild(0).GetComponent<ParticleSystem>(); |
| | | // ps.Play(); |
| | | // Destroy(obj, ps.main.duration); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <exception cref="InvalidOperationException"> |
| | | /// Throws exception if not in Build State or <see cref="m_CurrentTower"/> is not at a valid position |
| | | /// </exception> |
| | | public void PlaceTower(int lvl = 0, bool isUpgrade = false, bool opponent = false) |
| | | public void PlaceTower(int lvl = 0, bool isUpgrade = false, bool opponent = false, bool isFirstAppear = false) |
| | | { |
| | | if (!isBuilding) |
| | | throw new InvalidOperationException("Trying to place tower when not in a Build Mode"); |
| | |
| | | // River: 内部缓存数据,用于后期容易找到数据. |
| | | addTower(createdTower); |
| | | CancelGhostPlacement(); |
| | | if (!isUpgrade) |
| | | if (isFirstAppear) |
| | | { |
| | | PlayFirstAppearEffect(createdTower.towerName, createdTower.transform.position); |
| | | } |
| | | else if (!isUpgrade) |
| | | { |
| | | PlayAppearEffect(createdTower.transform.position); |
| | | } |
| | | else |
| | | { |
| | | PlayUpgradeEffect(createdTower); |
| | | } |
| | | |
| | | // 处理成长骰子,复制骰子等等功能. |
| | | if (lvl == 0) |
| | | { |
| | | ProcessFeatureTower(createdTower); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 播放首次宝石出现特效 |
| | | /// </summary> |
| | | public void PlayFirstAppearEffect(string towerName, Vector3 worldPos) |
| | | { |
| | | if (towerName.StartsWith("GrowUpTower")) |
| | | { |
| | | //火元素 |
| | | PlayAppearEffect(worldPos, fireAppearEffect1); |
| | | PlayAppearEffect(worldPos, fireAppearEffect2); |
| | | if (Application.platform == RuntimePlatform.WindowsEditor) |
| | | { |
| | | //UnityEditor.EditorApplication.isPaused = true; |
| | | } |
| | | } |
| | | else if (towerName.StartsWith("BlinkTower")) |
| | | { |
| | | //木元素 |
| | | PlayAppearEffect(worldPos, woodAppearEffect1); |
| | | PlayAppearEffect(worldPos, woodAppearEffect2); |
| | | |
| | | } |
| | | else if (towerName.StartsWith("CopyCatTower")) |
| | | { |
| | | //水元素 |
| | | PlayAppearEffect(worldPos, waterAppearEffect1); |
| | | PlayAppearEffect(worldPos, waterAppearEffect2); |
| | | } |
| | | } |
| | | void PlayAppearEffect(Vector3 worldPos, GameObject prefab) |
| | | { |
| | | GameObject obj = Instantiate(prefab); |
| | | obj.transform.position = worldPos; |
| | | Vector3 pos = obj.transform.position; |
| | | pos.y += 5f; |
| | | obj.transform.position = pos; |
| | | |
| | | ParticleSystem ps = obj.GetComponent<ParticleSystem>(); |
| | | |
| | | if (ps == null) |
| | | ps = obj.transform.GetChild(0).GetComponent<ParticleSystem>(); |
| | | |
| | | ps.Play(); |
| | | Destroy(obj, ps.main.duration); |
| | | } |
| | | |
| | | public void PlayAppearEffectGuide(Vector3 worldPos) |
| | | { |
| | | GameObject obj = Instantiate(TowerAppearEffectPrefabGuide); |
| | | obj.transform.position = worldPos; |
| | | |
| | | Vector3 pos = obj.transform.position; |
| | | pos.y += 5f; |
| | | obj.transform.position = pos; |
| | | |
| | | ParticleSystem ps = obj.GetComponent<ParticleSystem>(); |
| | | |
| | | if (ps == null) |
| | | ps = obj.transform.GetChild(0).GetComponent<ParticleSystem>(); |
| | | |
| | | ps.Play(); |
| | | |
| | | Destroy(obj, ps.main.duration); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | Destroy(obj, ps.main.duration); |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 播放升级特效 |
| | | /// </summary> |
| | | /// <param name="worldPos"></param> |
| | | public void GuidePlayUpgradeEffect(Vector3 position) |
| | | { |
| | | GameObject effect = TowerUpgradeEffectPrefab; |
| | | |
| | | // 在sTower的位置播放升级特效 |
| | | GameObject obj = Instantiate(effect); |
| | | GameObject obj = Instantiate(TowerUpgradeEffectPrefabGuide); |
| | | obj.transform.position = position; |
| | | |
| | | Vector3 pos = obj.transform.position; |
| | | pos.y += 5f; |
| | | obj.transform.position = pos; |
| | |
| | | |
| | | if (ps == null) |
| | | ps = obj.transform.GetChild(0).GetComponent<ParticleSystem>(); |
| | | |
| | | ps.Play(); |
| | | Destroy(obj, ps.main.duration); |
| | | } |
| | |
| | | if (!towerPriceText) |
| | | { |
| | | towerPriceText = randomTowerBtn.transform.Find("cashText").GetComponent<TextMeshProUGUI>(); |
| | | towerPriceText1 = SkillTowerBtn.transform.Find("cashText").GetComponent<TextMeshProUGUI>(); |
| | | if (towerPriceText) |
| | | towerPriceText.text = tpMgr.currentTowerPrice.ToString(); |
| | | if (towerPriceText1) |
| | | towerPriceText1.text = tpMgr.currentTowerPrice.ToString(); |
| | | } |
| | | else |
| | | { |
| | | towerPriceText.text = tpMgr.currentTowerPrice.ToString(); |
| | | towerPriceText1.text = tpMgr.currentTowerPrice.ToString(); |
| | | } |
| | | |
| | | // 无法支付新的塔防价格,按钮变灰. |
| | |
| | | if (towerPriceText) |
| | | { |
| | | towerPriceText.color = new Color(0.5f, 0.5f, 0.5f); |
| | | towerPriceText1.color = new Color(0.5f, 0.5f, 0.5f); |
| | | } |
| | | tdBuyDisable = true; |
| | | } |
| | |
| | | return; |
| | | |
| | | if (towerPriceText) |
| | | { |
| | | towerPriceText.color = new Color(1.0f, 1.0f, 1.0f); |
| | | towerPriceText1.color = new Color(1.0f, 1.0f, 1.0f); |
| | | } |
| | | |
| | | if (randomTowerBtn) |
| | | { |
| | |
| | | /// <param name="val"></param> |
| | | public void generateBloodText(Vector3 wpos, float val, bool crit = false, bool doubleHit = false, bool poison = false) |
| | | { |
| | | if (Mathf.FloorToInt(val) == 0) return; |
| | | |
| | | Vector3 spos = m_Camera.WorldToScreenPoint(wpos); |
| | | TextMoveDoTween tm; |
| | | if (crit) |
| | |
| | | // 获取相应的放置区域。 |
| | | GameObject placeObj = GameObject.FindGameObjectWithTag("PlaceTower"); |
| | | if (placeObj != null) |
| | | { |
| | | m_CurrentArea = placeObj.GetComponent<IPlacementArea>(); |
| | | dragTowerPlacement = placeObj.GetComponent<IPlacementArea>() as TowerPlacementGridEndless; |
| | | } |
| | | placeObj = GameObject.FindGameObjectWithTag("PlaceTowerOpponent"); |
| | | EventCenter.Ins.Add((int)KTGMGemClient.EventType.EndlessHeartAllLose, AllHeartLose); |
| | | } |
| | |
| | | /// 直接在IPlaceArea上随机放置一个Tower。这是随机放置塔防的入口类。这是入口的塔防类。 |
| | | /// </summary> |
| | | /// <param name="tow"></param> |
| | | public bool RandomPlaceTower(Tower tow, int posx = -1, int posy = -1, int lvl = 0, int forceCost = -1, bool isUpgrade = false) |
| | | public bool RandomPlaceTower(Tower tow, int posx = -1, int posy = -1, int lvl = 0, int forceCost = -1, bool isUpgrade = false, bool isFirstAppear = false) |
| | | { |
| | | // 获取IPlaceArea. |
| | | if (m_CurrentArea == null) |
| | |
| | | bool successfulPurchase = EndlessLevelManager.instance.Currency.TryPurchase(cost); |
| | | if (!successfulPurchase) return false; |
| | | |
| | | EndlessRandomTower.instance.UpdateDescDisplay(); |
| | | SetUpGhostTower(tow); |
| | | //Debug.Log("设置影子塔防."); |
| | | m_CurrentTower.Show(); |
| | |
| | | OnSuccessBuyTower(); |
| | | SetState(State.Building); |
| | | |
| | | PlaceTower(lvl, isUpgrade); |
| | | PlaceTower(lvl, isUpgrade, false, isFirstAppear); |
| | | } |
| | | |
| | | return true; |
| | |
| | | // 计算偏移值. |
| | | CalSelTowerScreenOffset(info, controller); |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 鼠标选中一个Tower的时候,计算当前鼠标位置与当前Tower位置在屏幕上坐标位置的偏移量。 |
| | |
| | | { |
| | | base.Awake(); |
| | | |
| | | DOTween.Init(true, true, LogBehaviour.Verbose).SetCapacity(200, 10); |
| | | randomTowerBtn = transform.Find("BottomCanvas/Panel/TowerBuyBtn").GetComponent<Button>(); |
| | | //DOTween.Init(true, true, LogBehaviour.Verbose).SetCapacity(200, 10); |
| | | |
| | | state = State.Normal; |
| | | m_Camera = GetComponent<Camera>(); |
| | | m_Camera = GameObject.Find("SceneCamera3D").GetComponent<Camera>(); |
| | | //m_Camera = GetComponent<Camera>(); |
| | | TowerDestroyArr = new bool[5, AttackRowNumbers]; |
| | | } |
| | | |
| | |
| | | return currentEventSystem.IsPointerOverGameObject(pointerId); |
| | | } |
| | | |
| | | WaveLineSelEffect currentEffect; |
| | | /// <summary> |
| | | /// Move the ghost to the pointer's position |
| | | /// </summary> |
| | |
| | | if (npt.overWaveLine) |
| | | { |
| | | WaveLineSelEffect selEff = npt.wavelineHit.Value.collider.GetComponent<WaveLineSelEffect>(); |
| | | if (selEff) |
| | | selEff.SetWaveLineSel(true); |
| | | if (selEff != currentEffect) |
| | | { |
| | | if (currentEffect != null) |
| | | { |
| | | currentEffect.SetParticleSystem(false); |
| | | } |
| | | currentEffect = selEff; |
| | | currentEffect.SetParticleSystem(true); |
| | | } |
| | | //selEff.SetWaveLineSel(true); |
| | | } |
| | | else |
| | | { |
| | | if (currentEffect != null) |
| | | { |
| | | currentEffect.SetParticleSystem(false); |
| | | currentEffect = null; |
| | | } |
| | | } |
| | | } |
| | | // 炸弹是区域攻击显示: |
| | | if (m_CurrentTower.controller.towerFeature == EFeatureTower.Skill_Bomb) |
| | | else if (m_CurrentTower.controller.towerFeature == EFeatureTower.Skill_Bomb) |
| | | { |
| | | // 测试代码与战场区域碰撞,碰撞后显示攻击区域: |
| | | BattleAreaRaycast(ref npt); |
| | |
| | | /// <param name="worldPos">世界坐标</param> |
| | | public void PlayToAttackEffect(int attributeId, Vector3 worldPos) |
| | | { |
| | | string path = $"UI/ToBattle_{attributeId}"; |
| | | string path = ""; |
| | | if (attributeId == 101) |
| | | { |
| | | path = "UI/Effect_Elf_Huo_DengChang_101"; |
| | | } |
| | | else if (attributeId == 105) |
| | | { |
| | | path = "UI/Effect_Elf_Shui_DengChang_105"; |
| | | } |
| | | else if (attributeId == 109) |
| | | { |
| | | path = "UI/Effect_Elf_Mu_DengChang_109"; |
| | | } |
| | | |
| | | GameObject prefab = Resources.Load<GameObject>(path); |
| | | GameObject obj = Instantiate(prefab); |
| | | obj.transform.position = worldPos; |